-
Notifications
You must be signed in to change notification settings - Fork 14
89 lines (79 loc) · 2.95 KB
/
cosmic-ray.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
name: cosmic-ray-integration
on:
push:
branches:
- spike-mutation-testing-cosmic-ray
jobs:
python-dependencies:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: |
echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pipenv'
- name: Install Pipenv
run: pip install pipenv==2023.8.22
- name: Install virtual environment
run: |
sudo apt-get install libsnappy-dev
pipenv install --dev
test-cosmic-ray:
needs: python-dependencies
strategy:
matrix:
mutation-package-under-test: [ questionnaire, routes ]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- run: |
echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pipenv'
- name: Install apt dependencies
run: |
sudo apt-get install libsnappy-dev libgconf-2-4 jq
# Install wkthtmltopdf with patched Qt
sudo apt-get install -y xfonts-base xfonts-75dpi
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
- name: Write app version
run: printf "local" > .application-version
- name: Install pipenv
run: pip install pipenv==2023.8.22
- name: Install virtual environment
run: pipenv install --dev
- name: Load templates
run: make load-design-system-templates
- name: Compile translations
run: make translate
- name: Link env vars
run: ln -sf .development.env .env
- name: Run cosmic-ray
run: |
# Manually generate a file to pop the config in
cat <<EOF > cosmic-ray.ini
[cosmic-ray]
module-path = "app/${{ matrix.mutation-package-under-test }}/"
timeout = 120.0
excluded-modules = []
test-command = "py.test -n auto tests/integration/${{ matrix.mutation-package-under-test }}"
[cosmic-ray.distributor]
name = "local"
EOF
cat cosmic-ray.ini
# Initialise cosmic-ray
pipenv run cosmic-ray init cosmic-ray.ini cosmic-ray.sqlite
# Run it
pipenv run cosmic-ray --verbosity=INFO exec cosmic-ray.ini cosmic-ray.sqlite
- name: Save HTML output
run: |
pipenv run cr-html cosmic-ray.sqlite > cosmic-ray-report-${{ matrix.mutation-package-under-test }}.html
- uses: actions/upload-artifact@v3
with:
name: cosmic-ray-report-${{ matrix.mutation-package-under-test }}
path: cosmic-ray-report-${{ matrix.mutation-package-under-test }}.html