-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 1.46 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
name: CI
on: [push]
jobs:
lint:
runs-on: ubuntu-latest
env:
FLAKE8: venv/bin/flake8
MYPY: venv/bin/mypy
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Set up virtualenv
run: python -m venv venv
- name: Install dependencies
run: |
venv/bin/pip install -r script/linting/requirements.txt
venv/bin/pip install -r script/typing/requirements.txt
- name: Linting
run: script/linting/lint
- name: Type checking
run: script/typing/check
build:
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
# Install package to generate version info
python -m pip install .
- name: Build package
run: |
python -m build
- name: Save built package
uses: actions/upload-artifact@v3
with:
name: package
path: |
dist
- name: Publish to PyPi
if: ${{ github.ref_type == 'tag' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
print_hash: true