Skip to content

Commit 662262f

Browse files
committed
Set up GitHub actions for running tests
This is a first stab at setting up GitHub actions for running the catalog-api CI tests. At this point I've just migrated the old Travis-CI setup to a GitHub actions workflow. Not sure if I need the Docker hub login anymore? I'll try it without and see what happens.
1 parent 5b36659 commit 662262f

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Build and compose docker images, run tests
2+
on: [push, workflow_dispatch]
3+
jobs:
4+
build-and-test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: check out repository
8+
uses: actions/checkout@v4
9+
- name: build CI settings .env
10+
run: ./build_ci_settings.sh
11+
- name: pull external service images via docker-compose
12+
run: |
13+
./docker-compose.sh pull default-db-test sierra-db-test \
14+
solr-test-for-update solr-test-for-search \
15+
redis-celery-test redis-appdata-test
16+
- name: build our docker image and services
17+
run: ./docker-compose.sh build celery-worker-test manage-test test
18+
- name: build databases
19+
run: ./init-dockerdata.sh tests
20+
- name: run all tests
21+
run: ./docker-compose.sh run --rm test

build_ci_settings.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env sh
2+
3+
path_to_settings=django/sierra/sierra/settings/.env
4+
test_settings="SECRET_KEY=\"Some secret key\"
5+
SETTINGS_MODULE=sierra.settings.test
6+
ALLOWED_HOSTS=localhost
7+
SIERRA_DB_USER=none
8+
SIERRA_DB_PASSWORD=none
9+
SIERRA_DB_HOST=none
10+
DEFAULT_DB_USER=none
11+
DEFAULT_DB_PASSWORD=none
12+
DEFAULT_DB_PORT=3307
13+
TEST_SIERRA_DB_USER=postgres
14+
TEST_SIERRA_DB_PASSWORD=whatever
15+
TEST_SIERRA_DB_PORT=5332
16+
TEST_DEFAULT_DB_USER=mariadb
17+
TEST_DEFAULT_DB_PASSWORD=whatever
18+
TEST_DEFAULT_DB_PORT=3206
19+
TIME_ZONE=America/Chicago
20+
EXPORTER_EMAIL_ON_ERROR=false
21+
EXPORTER_EMAIL_ON_WARNING=false
22+
EXPORTER_AUTOMATED_USERNAME=django_admin
23+
"
24+
25+
echo "$test_settings" > $path_to_settings
26+
echo "Settings file created:"
27+
cat $path_to_settings

0 commit comments

Comments
 (0)