Skip to content

Commit 11834d0

Browse files
committed
Switch CI pipelines to exclusively GitHub Actions
- Replace flake8 checks with ruff - Switch to pypi trusted publishers - Use fancy GHA pytest output
1 parent 3a70b41 commit 11834d0

File tree

8 files changed

+98
-280
lines changed

8 files changed

+98
-280
lines changed

.azure-pipelines.yml

Lines changed: 0 additions & 167 deletions
This file was deleted.

.azure-pipelines/ci.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.azure-pipelines/flake8-validation.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

.azure-pipelines/syntax-validation.py

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Python
12+
uses: actions/setup-python@v4
13+
with:
14+
python-version: 3.11
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install pytest build
19+
- name: Build distribution
20+
run: |
21+
python -m build
22+
pip install dist/*.whl
23+
- uses: actions/upload-artifact@v3
24+
with:
25+
path: ./dist/*
26+
27+
test:
28+
needs: build
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
python-version: ["3.8", "3.9", "3.10", "3.11"]
33+
34+
steps:
35+
- uses: actions/checkout@v3
36+
- uses: actions/download-artifact@v3
37+
with:
38+
name: artifact
39+
path: dist
40+
41+
- name: Set up Python ${{ matrix.python-version }}
42+
uses: actions/setup-python@v4
43+
with:
44+
python-version: ${{ matrix.python-version }}
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install pytest dist/*.whl -r requirements_dev.txt pytest-md pytest-emoji
49+
- name: Run pytest
50+
uses: pavelzw/pytest-action@b09a85cd1831cbaae76125fcae4a1e4b137ef026 # v2.1.3
51+
with:
52+
click-to-expand: false
53+
emoji: true
54+
job-summary: true
55+
verbose: false
56+
custom-arguments: "-v -ra --cov=zocalo --cov-report=xml --cov-branch"
57+
custom-pytest: "PYTHONDEVMODE=1 pytest"
58+
report-title: "Test Report"
59+
- name: Upload Coverage to Codecov
60+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
61+
62+
pypi-publish:
63+
name: Upload release to PyPI
64+
needs: test
65+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
66+
runs-on: ubuntu-latest
67+
environment:
68+
name: release
69+
url: https://pypi.org/watchdir
70+
permissions:
71+
id-token: write
72+
steps:
73+
- uses: actions/download-artifact@v3
74+
with:
75+
name: artifact
76+
path: dist
77+
- name: Publish package distributions to PyPI
78+
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "main", "master" ]
5+
branches: ["main"]
66
pull_request:
77
branches: [ "main" ]
88
schedule:

.github/workflows/linting.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Linting"
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
lint:
8+
name: Lint
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Ruff Check
16+
uses: jpetrucciani/ruff-check@33f3725e751a187bb666b7d7a7094d38a2df12db # 0.0.239

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ profile = "black"
8888

8989
[tool.pytest.ini_options]
9090
required_plugins = "pytest-mock requests-mock"
91+
testpaths = [
92+
"tests",
93+
]
9194

9295
[tool.ruff]
9396
line-length = 88

0 commit comments

Comments
 (0)