Skip to content

Commit c1a90b6

Browse files
committed
.github: add GHA support to test/build
1 parent 950282b commit c1a90b6

File tree

2 files changed

+118
-0
lines changed

2 files changed

+118
-0
lines changed

.github/workflows/build.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: LEEP release
2+
3+
on:
4+
workflow_run:
5+
workflows: [LEEP tests]
6+
types: [completed]
7+
8+
jobs:
9+
build:
10+
11+
name: ${{ matrix.name }}
12+
runs-on: ${{ matrix.os }}
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
# && startsWith(github.ref, 'refs/tags/v')
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- name: Ubuntu latest with py3.x
21+
os: ubuntu-latest
22+
python: "3.x"
23+
24+
steps:
25+
- uses: actions/checkout@v6
26+
27+
- name: Setup python
28+
uses: actions/setup-python@v6
29+
with:
30+
python-version: ${{ matrix.python }}
31+
32+
- name: Install basic Python packages
33+
run: |
34+
python -m pip install --upgrade pip
35+
python -m pip install \
36+
"setuptools>=64" \
37+
"setuptools-scm>=8" \
38+
wheel \
39+
twine
40+
which python
41+
python --version
42+
python -m pip --version
43+
python -m twine -h
44+
45+
- name: Build
46+
run: |
47+
python3 -m build -v
48+
49+
- name: List artifacts
50+
run: |
51+
ls dist/*
52+
53+
- name: Save artifacts
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: "leep ${{ matrix.name }}"
57+
path: dist/*
58+
59+
- name: Check wheels
60+
run: |
61+
python -m twine check dist/leep*.whl
62+
63+
- name: Check source
64+
run: |
65+
python -m twine check dist/leep*.tar.*
66+
67+
#- name: Upload package
68+
# env:
69+
# PYPI_REPOSITORY: pypi
70+
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
71+
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
72+
# run: |
73+
# python -m twine upload --repository ${PYPI_REPOSITORY} dist/*

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: LEEP tests
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
test:
7+
8+
name: ${{ matrix.name }}
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- name: Ubuntu latest with py3.x
16+
os: ubuntu-latest
17+
python: "3.x"
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Setup python
23+
uses: actions/setup-python@v6
24+
with:
25+
python-version: ${{ matrix.python }}
26+
27+
- name: Install basic Python packages
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install -r requirements.txt
31+
python -m pip install pytest flake8
32+
which python
33+
python --version
34+
python -m pip --version
35+
python -m pytest --version
36+
python -m flake8 --version
37+
38+
- name: Lint
39+
run: |
40+
find . -name "*.py" -exec flake8 {} +
41+
continue-on-error: true
42+
43+
- name: Test
44+
run: |
45+
python -m pytest -v

0 commit comments

Comments
 (0)