Skip to content

Commit 6fd69f3

Browse files
authored
ci: add test config
1 parent 2f15639 commit 6fd69f3

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/tests.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
branches:
8+
- main
9+
pull_request:
10+
paths-ignore:
11+
- 'docs/**'
12+
branches:
13+
- '**'
14+
15+
jobs:
16+
tests:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@master
21+
22+
- name: install hunspell-en-gb
23+
run: sudo apt-get install -y hunspell-en-gb
24+
25+
- name: set python version
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: "3.10"
29+
30+
- name: install poetry
31+
run: |
32+
curl -sSL https://install.python-poetry.org | python - --preview
33+
34+
- name: Update PATH
35+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
36+
37+
- name: configure poetry
38+
run: poetry config virtualenvs.in-project true
39+
40+
- name: set up python cache
41+
uses: actions/cache@v3
42+
id: python-cache
43+
with:
44+
path: .venv
45+
key: venv-${{ hashFiles('**/poetry.lock') }}
46+
47+
- name: ensure cache is healthy
48+
if: steps.python-cache.outputs.cache-hit == 'true'
49+
run: timeout 10s poetry run pip --version || rm -rf .venv
50+
51+
- name: install python dependencies
52+
if: steps.python-cache.outputs.cache-hit != 'true'
53+
run: poetry install
54+
55+
- name: Install pytest plugin
56+
run: poetry run pip install pytest-github-actions-annotate-failures
57+
58+
- name: run tests
59+
run: make ci

0 commit comments

Comments
 (0)