forked from mongodb-haskell/mongodb
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (59 loc) · 1.59 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
56
57
58
59
60
61
62
63
64
name: Test
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: haskell-actions/run-fourmolu@v9
with:
version: "0.14.1.0"
pattern: Database/**/*.hs
extra-args: --indentation 2
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_VERSION=${{ matrix.mongodb }} \
-e MONGO_INITDB_ROOT_USERNAME=testadmin \
-e MONGO_INITDB_ROOT_PASSWORD=123 \
${{ matrix.mongodb }}
fi
# build & run tests
stack test --fast