-
Notifications
You must be signed in to change notification settings - Fork 3
73 lines (62 loc) · 1.83 KB
/
pr_and_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
62
63
64
65
66
67
68
69
70
71
72
73
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
name: PR and Main
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }}
cancel-in-progress: true # cancel jobs from previous push
defaults:
run:
shell: bash -l {0} # required for conda env
jobs:
formatting:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/ci.txt
- run: tox -e static
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply automatic formatting
tests:
needs: formatting
name: tests-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macos-11", "windows-2019"]
env:
JUPYTER_PLATFORM_DIRS: 1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # history required so cmake can determine version
- name: Setup conda environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
cache-environment: true
- run: conda develop src
- run: python -m pytest -v tests
docs:
needs: tests
name: docs-${{ matrix.os }}
uses: ./.github/workflows/docs.yml
with:
publish: false
version: ${{ github.ref_name }}
branch: ${{ github.head_ref == '' && github.ref_name || github.head_ref }}
platform: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macos-11", "windows-2019"]