-
Notifications
You must be signed in to change notification settings - Fork 7
70 lines (59 loc) · 1.73 KB
/
codeqc.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
name: "QC 🛠️"
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
activate-environment: torchsurv
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('dev/environment.yml') }}-${{ env.CACHE_NUMBER }}
env:
# Increase this value to reset cache if environment.yml has not changed
CACHE_NUMBER: 1
- name: Update conda environment
run:
conda env update -n torchsurv -f dev/environment.yml
if: steps.cache.outputs.cache-hit != 'true'
- name: Code QC
shell: bash -l {0}
run: |
conda activate torchsurv
./dev/codeqc.sh check
- name: Tests
shell: bash -l {0}
run: |
conda activate torchsurv
./dev/run-doctests.sh
./dev/run-unittests.sh
- name: Test-build docs
shell: bash -l {0}
run: |
conda activate torchsurv
./dev/build-docs.sh
tar czvf docs.tar.gz -C docs/_build/html .
- name: 'Upload Docs Tarball'
uses: actions/upload-artifact@v4
with:
name: docs.tar.gz
path: docs.tar.gz
retention-days: 5