-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (130 loc) · 3.35 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Check and Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions: read-all
jobs:
format:
name: Check formatting
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python: ['3.11', '3.12']
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Check formatting
run: make format
lint:
name: Check for erroneous constructs
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python: ['3.11', '3.12']
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Check for erroneous constructs
run: make lint
links:
name: Check Markdown links
runs-on: ubuntu-20.04
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Check Markdown links
run: |
npm install -g markdown-link-check
make links
test:
name: Run tests
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python: ['3.11', '3.12']
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Run tests
run: make test
build:
name: Make pip packages
runs-on: ubuntu-20.04
needs: [format, lint, test]
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
- name: Building toltecmk
run: make build
- uses: actions/upload-artifact@v3
with:
name: pip
path: dist/*
standalone:
name: Make Standalone
runs-on: ubuntu-20.04
needs: [format, lint, test]
steps:
- name: Checkout the Git repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
- name: Building toltecmk
run: make standalone
- uses: actions/upload-artifact@v3
with:
name: toltecmk
path: toltecmk
publish:
name: Publish to PyPi
runs-on: ubuntu-20
needs: [build, links]
if: github.repository == 'toltec-dev/build' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/toltecmk
steps:
- name: Download pip packages
id: download
uses: action/download-artifact@v4
with:
name: pip
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ${{ steps.download.outputs.download-path }}