-
Notifications
You must be signed in to change notification settings - Fork 47
55 lines (50 loc) · 1.35 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Test
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mongodb:
- mongo:4.0
- mongo:5.0
- mongo:6.0
- mongo:7.0
- mongo_atlas
ghc:
- "8.10.4"
- "9.4.7" # oldest version with HLS support
- latest
steps:
- uses: actions/checkout@v3
- name: Setup Haskell tooling
uses: haskell-actions/setup@v2
with:
enable-stack: true
ghc-version: ${{ matrix.ghc }}
stack-version: latest
- name: Setup container and run tests
run: |
# the job-level 'if' expression is evaluated before the matrix variable
# so it cannot be used to configure this step
if [[ ${{ matrix.mongodb }} = "mongo_atlas" ]]
then
export CONNECTION_STRING=${{ secrets.CONNECTION_STRING }}
else
docker run -d \
-p 27017:27017 \
-e MONGO_INITDB_ROOT_USERNAME=testadmin \
-e MONGO_INITDB_ROOT_PASSWORD=123 \
${{ matrix.mongodb }}
fi
# build & run tests
export MONGO_VERSION=${{ matrix.mongodb }}
stack test --fast