-
Notifications
You must be signed in to change notification settings - Fork 5
76 lines (59 loc) · 1.83 KB
/
pull_request.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
name: Pull Request
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
# Useful for workflow debugging
# printJob:
# name: Print event
# runs-on: ubuntu-latest
# steps:
# - name: Dump GitHub context
# env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
# run: |
# echo "$GITHUB_CONTEXT"
run_tests:
runs-on: ubuntu-latest
steps:
# Set-up dependencies
- name: Check-out repo
uses: actions/checkout@v3
with:
fetch-depth: 0 # Needed for tags to be fetched; see https://github.com/actions/checkout/issues/290
- name: Set-up MPI
uses: mpi4py/setup-mpi@v1
- name: Set-up Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Set-up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'poetry'
# Configure project
- name: Set project version
run: poetry version $(git describe --tags --abbrev=0)
# Install the project (we need some of the tools installed here for liniting etc)
- name: Install the project
run: poetry install --no-interaction --extras "docs dev"
# Enforce code formating standards
- name: Enforce linting
run: poetry run ruff .
- name: Enforce formating
run: poetry run black .
# Make sure the Poetry project is properly maintained
- name: Enforce maintainance of Poetry project
run: |
poetry check
poetry lock --check
# Run tests
- name: Generate build
run: poetry build
- name: Code tests
run: poetry run pytest
- name: Documentation build test
run: poetry run make docs