-
Notifications
You must be signed in to change notification settings - Fork 6
106 lines (85 loc) · 2.34 KB
/
CI.yml
File metadata and controls
106 lines (85 loc) · 2.34 KB
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
# Copyright © 2020 Interplanetary Database Association e.V.,
# Planetmint and IPDB software contributors.
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
name: CI
on:
push:
branches:
- "*"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
options: "--check -l 119"
src: "."
audit-doc-builds:
runs-on: ubuntu-latest
needs: lint
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup poetry
uses: Gr1N/setup-poetry@v8
- name: Install dependencies
run: poetry install
- name: Create requirements.txt
run: poetry run pip freeze > requirements.txt
- name: Audit dependencies
run: |
poetry run pip-audit \
--ignore-vuln PYSEC-2024-225 \
--ignore-vuln GHSA-3ww4-gg4f-jr7f \
--ignore-vuln GHSA-9v9h-cgj8-h64p \
--ignore-vuln GHSA-h4gh-qq45-vh27
- name: Run docs build
run: poetry run make -C docs html
unit-tests:
runs-on: ubuntu-latest
needs: audit-doc-builds
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup poetry
uses: Gr1N/setup-poetry@v8
- name: Run tests
run: make test
publish:
needs: unit-tests
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup poetry
uses: Gr1N/setup-poetry@v8
- name: Install dependencies
run: poetry install --with dev
- name: Upload to PyPI
run: |
poetry build
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
- name: Upload to GitHub
uses: softprops/action-gh-release@v1
with:
files: dist/*