-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (50 loc) · 1.53 KB
/
main.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
name: test
# Test oups.
on:
push:
branches: "*"
# pull_request:
# branches: main
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
# Checks-out repository under $GITHUB_WORKSPACE, so the job can access it
- name: Checkout
uses: actions/checkout@v2
# Python setup
- name: Set up Python environment
uses: actions/setup-python@v2
with:
python-version: "3.10"
# Install dependencies
# setuptools required by pre-commit
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel pre-commit pytest poetry
# Setup pre-commit cache
- name: Setup pre-commit cache
id: cache-pre-commit
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.github/workflows/*.yml', '.pre-commit-config.yaml') }}
# Run pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
# Setup poetry cache
- name: Get poetry cache dir
id: cache-poetry
run: echo "dir=$(poetry config cache-dir)" >> $GITHUB_OUTPUT
- name: Setup poetry cache
uses: actions/cache@v2
with:
path: ${{ steps.cache-poetry.outputs.dir }}
key: poetry-${{ hashFiles('.github/workflows/*.yml', '**/pyproject.toml') }}
# Install oups
- name: Install oups
run: poetry install
# Run pytest
- name: Run pytest
run: poetry run pytest