-
Notifications
You must be signed in to change notification settings - Fork 2
94 lines (82 loc) · 2.82 KB
/
backend-and-models.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Agrammon backend and models
on:
push:
branches:
- '*'
tags-ignore:
- '*'
pull_request:
jobs:
raku:
strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-latest
raku-version:
- '2023.02'
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:13
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: agrammon_test
ports:
- 5432:5432
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Install LaTeX
run: |
sudo apt update
sudo apt-get install texlive texlive-luatex texlive-latex-recommended texlive-latex-extra texlive-science
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup raku
uses: Raku/setup-raku@v1
with:
raku-version: ${{ matrix.raku-version }}
- name: Setup Raku cache
uses: actions/cache@v2
id: rakuCache
with:
path: .raku
key: ${{ runner.os }}-${{ matrix.raku-version }}-${{ hashFiles('./dev/META6.json') }}
- name: Install Raku modules
if: steps.rakuCache.outputs.cache-hit != 'true'
run: |
mkdir -p $GITHUB_WORKSPACE/.raku
zef --install-to=inst#$GITHUB_WORKSPACE/.raku --debug --deps-only --/test --test-depends install .
- name: Checksum model dir
run: |
find t/test-data/Models/hr-inclNOx* -type f -print0 | sort -z | xargs -0 shasum > ./MODEL_MD5
cat ./MODEL_MD5
mkdir -p $HOME/.agrammon
- name: Setup model cache
uses: actions/cache@v2
id: modelCache
with:
path: $HOME/.agrammon
key: AgrammonModels-${{ hashFiles('./MODEL_MD5') }}
- name: Load test database
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: agrammon_test
PGPASSFILE: ./dev/pgpass
AGRAMMON_DUMP: ./t/test-data/agrammon_test.dump.sql
run: |
chmod 0600 $PGPASSFILE
psql -U postgres -h localhost -c "CREATE USER agrammon PASSWORD 'agrammonATwork'" > /dev/null
psql -U postgres -h localhost -c "CREATE GROUP agrammon_user USER agrammon" > /dev/null
psql -U postgres -h localhost -c "GRANT ALL ON SCHEMA public TO agrammon_user" > /dev/null
psql -U postgres -h localhost -c "CREATE EXTENSION pgcrypto" agrammon_test > /dev/null
psql -U postgres -h localhost --file=$AGRAMMON_DUMP $POSTGRES_DB > /dev/null
- name: Run backend tests
run: |
RAKULIB=inst#$GITHUB_WORKSPACE/.raku $GITHUB_WORKSPACE/.raku/bin/prove6 -l -v t