-
Notifications
You must be signed in to change notification settings - Fork 1
109 lines (94 loc) · 3.04 KB
/
ci.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
105
106
107
108
109
name: CI
on: # yamllint disable-line rule:truthy
push:
pull_request:
env:
USE_DOCKER: true
jobs:
test:
runs-on: ["${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
- name: Install Dependencies
run: |
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
- name: Unit tests
run: |
make test
- name: Publish coverage to codecov.io.
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
if: ${{ !env.ACT }}
with:
fail_ci_if_error: true
files: ./coverage.xml
verbose: true
lint:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Install Dependencies
run: |
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
- name: Run linters.
run: |
make lint
check_cc_and_requirements:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- name: Check that requirements are up-to-date.
if: github.ref != 'refs/heads/master' && ! startsWith(github.ref, 'refs/tags')
run: |
make check-requirements
- name: Check that this project is up-to-date with cookiecutter.
if: github.ref != 'refs/heads/master' && ! startsWith(github.ref, 'refs/tags')
run: |
make check-cc
publish:
runs-on: [ubuntu-latest]
needs:
- test
- lint
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
- name: Install pypa/build
run: |
python -m pip install --user build setuptools_scm
- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/
- name: Build wheels
run: |
python setup.py sdist
- name: Build docs and publish them back to the master branch if necessary.
if: github.repository == 'bbugyi200/zorg' && github.ref == 'refs/heads/master'
run: |
./bin/publish_docs
- name: Publish distribution to PyPI
if: github.repository == 'bbugyi200/zorg' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true