-
Notifications
You must be signed in to change notification settings - Fork 9
99 lines (90 loc) · 2.66 KB
/
build.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
# Workflow to automate installation and unit testing of DeltaMetrics on various python versions and operating systems
name: build
on:
push:
pull_request:
schedule:
- cron: '0 0 1 * *' # run workflow at 12AM on first day of every month
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install nox
- name: Test with pytest
run: |
nox -s coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
lint:
runs-on: "ubuntu-latest"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install nox
run: pip install nox
- name: Run the linters
run: nox -s lint
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
pip install nox
sudo apt update -y && sudo apt install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended dvipng ffmpeg
- name: Build and test documentation
run: |
nox -s docs
- name: Debug
run: |
echo $REF
echo $EVENT_NAME
echo ${{ github.event_name == 'push' }}
echo ${{ github.ref == 'refs/heads/develop' }}
echo ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/develop' }}
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT_NAME: ${{ github.event_name }}
REF: ${{ github.ref }}
BRANCH: gh-pages
FOLDER: docs/build/html