-
Notifications
You must be signed in to change notification settings - Fork 8
105 lines (84 loc) · 2.66 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
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
strategy:
matrix:
include:
- conda_env: supernnova
conda_env_file: env/conda_env.yml
- conda_env: supernnova-cuda
conda_env_file: env/conda_gpu_env.yml
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
# Uncomment if you need mpi
# - name: Set-up MPI
# uses: mpi4py/setup-mpi@v1
- name: Set-up Cuda Toolkit
run: |
sudo apt-get update
sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: ${{matrix.conda_env}}
environment-file: ${{matrix.conda_env_file}}
- name: Verify Environment
shell: bash -l {0}
run: |
conda info
conda list
- name: Verify cuda support
if: ${{ matrix.conda_env == 'supernnova-cuda' }}
shell: bash -l {0}
run: python env/verify_cuda_support.py
# Configure project
- name: Set project version
shell: bash -l {0}
run: poetry version $(git describe --tags --match "v[0-9]*" --abbrev=0)
# Install the project (we need some of the tools installed here for liniting etc)
- name: Install the project
shell: bash -l {0}
run: poetry install --no-interaction --extras "docs dev"
# Enforce code formating standards
- name: Enforce linting
shell: bash -l {0}
run: poetry run ruff .
- name: Enforce formating
shell: bash -l {0}
run: poetry run black .
# Make sure the Poetry project is properly maintained
- name: Enforce maintainance of Poetry project
shell: bash -l {0}
run: |
poetry check
poetry lock --check
# Run tests
- name: Generate build
shell: bash -l {0}
run: poetry build
- name: Code tests
shell: bash -l {0}
run: poetry run pytest
- name: Documentation build test
shell: bash -l {0}
run: |
cd docs
poetry run make html