Merge branch 'master' into topic/simple_image_upload
[sgn.git] / .github / workflows / test.yml
blob0e6ac7552d46f0a9927f1d28b126739dddd51c58
1 on:
2   pull_request:
3     paths-ignore:
4       - 'docs/**'
5       - '**.md'
7 jobs:
8   test_breedbase:
9     runs-on: ubuntu-latest
10     container:
11       image: breedbase/breedbase:v0.33
12       env:
13         HOME: /root
14         MODE: 'TESTING'
15         PGPASSWORD: postgres
16         SGN_TEST_SERVER: http://test_breedbase:3010
17         SGN_REMOTE_SERVER_ADDR: selenium
18       volumes:
19         - ${{ github.workspace }}:/home/production/cxgn/sgn
20         - ${{ github.workspace }}:/home/vagrant/cxgn/sgn
21       options: --network-alias test_breedbase
23     services:
24       breedbase_db:
25         image: postgres:12.8
26         env:
27           POSTGRES_PASSWORD: postgres
28         # Set health checks to wait until postgres has started
29         options: >-
30           --health-cmd pg_isready
31           --health-interval 10s
32           --health-timeout 5s
33           --health-retries 5
35       selenium:
36         image: selenium/standalone-firefox:3.141.59
37         options: --health-cmd="curl --silent --head http://localhost:4444 || exit 1"
39     steps:
40       - name: Checkout sgn
41         uses: actions/checkout@v2
42     
43       - name: Run unit tests
44         run: prove --recurse t/unit
45       
46       - name: Load/dump fixture database and build node modules
47         run: |
48           echo "--version" > ~/.proverc
49           perl t/test_fixture.pl --dumpupdatedfixture
50           rm ~/.proverc
51         # work around run_all_patches.pl "what the heck - no TTY??" error
52         # https://github.com/actions/runner/issues/241#issuecomment-842566950
53         shell: 'script --flush --quiet --return --command "bash --noprofile --norc -eo pipefail {0}"'
55       - name: Run unit_fixture tests
56         # need entrypoint.sh to start slurm
57         # --nopatch to skip running fixture and db patches (already done in previous step)
58         run: /entrypoint.sh --nopatch t/unit_fixture
60       - name: Run unit_mech tests
61         run: /entrypoint.sh --nopatch t/unit_mech
63       - name: Run selenium tests
64         run: /entrypoint.sh --nopatch t/selenium2