Skip to content

Commit 3942eca

Browse files
committed
Rework the github actions workflows.
* Create a composite action for setting up the system. * Expand `check-install.yml` to check that installing works from all of; - GitHub - Checked out locally with `python setup.py install` - Checked out locally with `pip install -e .` - Building and then installing wheels. * Remove `wheel.yml` as covered by `check-install.yml`'s building and then installing wheels. Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
1 parent 0de2759 commit 3942eca

File tree

8 files changed

+262
-228
lines changed

8 files changed

+262
-228
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Functionality
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
9+
Functionality:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
antlr_runtime_type: [static, shared]
15+
include:
16+
- { python-version: 3.5, TOXENV: py35 }
17+
- { python-version: 3.6, TOXENV: py36 }
18+
- { python-version: 3.7, TOXENV: py37 }
19+
- { python-version: 3.8, TOXENV: py38 }
20+
- { python-version: 3.9, TOXENV: py39 }
21+
fail-fast: false
22+
23+
name: Functionality on Python ${{ matrix.python-version }} (with ${{ matrix.antlr_runtime_type}} antlr)
24+
25+
steps:
26+
- run: |
27+
echo "${{ github.repository }}/.github/workflows/system-setup@${{ github.sha }}"
28+
29+
- uses: mithro/fasm/.github/workflows/system-setup@setupcfg
30+
with:
31+
development-tools: true
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Run Tests
35+
run: |
36+
ANTLR4_RUNTIME_TYPE=${{ matrix.antlr_runtime_type }} tox -e ${{ matrix.TOXENV }}

.github/workflows/check-install.yml

Lines changed: 84 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,106 @@ jobs:
1010
GitHub:
1111
strategy:
1212
matrix:
13-
os: [windows-latest, macos-latest, ubuntu-20.04]
13+
os: [windows-latest, macos-latest, ubuntu-latest]
1414
fail-fast: false
1515

16-
name: GitHub
1716
runs-on: ${{ matrix.os }}
1817

1918
steps:
20-
- name: 🐍 Set up Python
21-
uses: actions/setup-python@v2
19+
- uses: '${{ github.repository }}/.github/workflows/system-setup@${{ github.sha }}'
2220
with:
23-
python-version: 3.x
21+
os: ${{ matrix.os }}
22+
git-checkout: false
2423

25-
- name: Install pip
24+
- name: Test installation
25+
shell: bash
2626
run: |
27-
pip install --upgrade pip
27+
pip install git+https://github.com/${GITHUB_REPOSITORY}.git@${GITHUB_SHA}#egg=fasm
2828
29-
- name: Install package's system dependencies (Ubuntu)
30-
if: startsWith(matrix.os, 'ubuntu')
29+
- name: Run smoke test
3130
run: |
32-
sudo apt-get update
33-
sudo apt-get install -y cmake default-jre-headless uuid-dev libantlr4-runtime-dev
31+
fasm --help
32+
33+
# - name: Run tests against installed version
34+
# run: |
35+
# cd tests; python test_simple.py
36+
37+
Checkout:
38+
strategy:
39+
matrix:
40+
os: [windows-latest, macos-latest, ubuntu-latest]
41+
cmd:
42+
- python setup.py install
43+
- pip install .
44+
- pip install -e . # Editable install
45+
fail-fast: false
46+
47+
name: Checkout with '${{ matrix.cmd }}'
48+
runs-on: ${{ matrix.os }}
3449

35-
- name: Install package's system dependencies (Mac OS X)
36-
if: startsWith(matrix.os, 'macos')
50+
steps:
51+
- uses: '${{ github.repository }}/.github/workflows/system-setup@${{ github.sha }}'
52+
with:
53+
os: ${{ matrix.os }}
54+
55+
- name: Install using '${{ matrix.cmd }}'
3756
run: |
38-
true
57+
${{ matrix.cmd }}
3958
40-
- name: Install package's system dependencies (Windows)
41-
if: startsWith(matrix.os, 'windows')
59+
- name: Run smoke test
4260
run: |
43-
true
61+
fasm --help
4462
45-
- name: Test installation
46-
shell: bash
63+
- name: Run tests against installed version
4764
run: |
48-
pip install git+https://github.com/${GITHUB_REPOSITORY}.git@${GITHUB_SHA}#egg=fasm
65+
cd tests; python test_simple.py
66+
67+
Wheel:
68+
strategy:
69+
matrix:
70+
os: [windows-latest, macos-latest, ubuntu-latest]
71+
fail-fast: false
4972

50-
- name: Run Smoke Test
73+
runs-on: ${{ matrix.os }}
74+
75+
steps:
76+
- uses: '${{ github.repository }}/.github/workflows/system-setup@${{ github.sha }}'
77+
with:
78+
os: ${{ matrix.os }}
79+
80+
- name: Build wheel
81+
run: |
82+
python setup.py bdist_wheel
83+
84+
- name: Upload wheel
85+
uses: actions/upload-artifact@v2
86+
with:
87+
name: fasm
88+
path: dist
89+
90+
- name: Install wheel
91+
run: |
92+
pip install dist/*.whl
93+
94+
- name: Run smoke test
5195
run: |
5296
fasm --help
97+
98+
- name: Run tests against installed version
99+
run: |
100+
cd tests; python test_simple.py
101+
102+
make-env:
103+
strategy:
104+
matrix:
105+
os: [windows-latest, macos-latest, ubuntu-latest]
106+
107+
name: make-env (Conda)
108+
runs-on: ${{ matrix.os }}
109+
110+
steps:
111+
- uses: '${{ github.repository }}/.github/workflows/checkout@${{ github.sha }}'
112+
113+
- name: Run tests
114+
run: |
115+
make tests

.github/workflows/check-style.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Style
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
9+
Style:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: '${{ github.repository }}/.github/workflows/system-setup@${{ github.sha }}'
14+
with:
15+
development-tools: true
16+
17+
- name: Check license headers
18+
run: make check-license
19+
20+
- name: Python style check
21+
run: |
22+
make format lint
23+
test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; }
24+
25+
- name: Python script checks
26+
run: make check-python-scripts
27+
28+
- name: C++ style check
29+
run: |
30+
make format-cpp
31+
test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; }
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 🧰 Checkout
2+
description: "Checkout the git repository correctly"
3+
4+
runs:
5+
using: "composite"
6+
7+
steps:
8+
- name: 🧰 Checkout
9+
uses: actions/checkout@v2
10+
with:
11+
# Always clone the full depth so git-describe works.
12+
fetch-depth: 0
13+
submodules: true

.github/workflows/presubmit.yml

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

0 commit comments

Comments
 (0)