Skip to content

Commit 196716b

Browse files
committed
Add GitHub action for make all
It is currently configured to be triggered manually either from the GitHub web frontend or from the GitHub API. `make all` can be run with a selected version of Ubuntu and Python, or a matrix of versions. Signed-off-by: Stefan Weil <[email protected]>
1 parent c8dcb5b commit 196716b

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Reusable GitHub workflow for `make all` on Linux'.
2+
3+
name: make all (Linux)
4+
5+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
6+
on:
7+
workflow_call:
8+
# Workflow triggered by other workflow.
9+
inputs:
10+
os:
11+
description: 'Stringified JSON object with operating systems'
12+
default: 'undefined'
13+
required: false
14+
type: string
15+
python-version:
16+
description: 'Python version'
17+
default: 'undefined'
18+
required: false
19+
type: string
20+
21+
jobs:
22+
make:
23+
#runs-on: ubuntu-latest
24+
runs-on: ${{ matrix.os }}
25+
26+
strategy:
27+
fail-fast: false
28+
matrix:
29+
os: ${{ fromJson(inputs.os) }}
30+
python-version: ${{ fromJson(inputs.python-version) }}
31+
32+
env:
33+
OS: ${{ matrix.os }}
34+
PYTHON_VERSION: ${{ matrix.python-version }}
35+
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions/setup-python@v2
39+
with:
40+
python-version: ${{ env.PYTHON_VERSION }}
41+
# architecture: x64
42+
- name: Show inputs.os
43+
run: echo ${{ inputs.os }}
44+
- name: Show environment
45+
run: echo OS=${{ env.OS }}, PYTHON_VERSION=${{ env.PYTHON_VERSION }}
46+
- name: Install dependencies
47+
run: sudo make deps-ubuntu PYTHON=python${{ env.PYTHON_VERSION}}
48+
- name: Make all
49+
run: make all PYTHON=python${{ env.PYTHON_VERSION }}
50+
- name: Run check
51+
run: make check

.github/workflows/makeall.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Run "make all" on selected Ubuntu and Python versions.
2+
3+
name: make all
4+
5+
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
6+
on:
7+
# Trigger workflow on push event.
8+
#push:
9+
# branches: [ ci ]
10+
11+
# Trigger workflow on pull request.
12+
# pull_request:
13+
# branches: [ ci ]
14+
15+
# Trigger workflow in GitHub web frontend or from API.
16+
workflow_dispatch:
17+
inputs:
18+
os:
19+
description: 'Operating system'
20+
required: true
21+
default: any
22+
type: choice
23+
options:
24+
- any
25+
- ubuntu-18.04
26+
- ubuntu-20.04
27+
python-version:
28+
description: 'Python version'
29+
required: true
30+
default: any
31+
type: choice
32+
options:
33+
- any
34+
- '3.6'
35+
- '3.7'
36+
- '3.8'
37+
- '3.9'
38+
- '3.10'
39+
40+
jobs:
41+
# Run builds for all Ubuntu and Python versions.
42+
build-any:
43+
# https://docs.github.com/en/actions/learn-github-actions/expressions
44+
if: ${{ (github.event.inputs.os == 'any') && (github.event.inputs.python-version == 'any') || (github.event.inputs.os == '') }}
45+
uses: ./.github/workflows/makeall-linux.yaml
46+
with:
47+
os: "[\'ubuntu-18.04\', \'ubuntu-20.04\']"
48+
python-version: "['3.6', '3.7', '3.8', '3.9', '3.10']"
49+
50+
# Run builds for all Ubuntu versions and selected Python version.
51+
build-any-os:
52+
if: ${{ (github.event.inputs.os == 'any') && (github.event.inputs.python-version != 'any') }}
53+
uses: ./.github/workflows/makeall-linux.yaml
54+
with:
55+
os: "[\'ubuntu-18.04\', \'ubuntu-20.04\']"
56+
python-version: "[\'${{ github.event.inputs.python-version }}\']"
57+
58+
# Run builds for selected Ubuntu version and all Python versions.
59+
build-any-python:
60+
if: ${{ (github.event.inputs.os != 'any') && (github.event.inputs.python-version == 'any') }}
61+
uses: ./.github/workflows/makeall-linux.yaml
62+
with:
63+
os: "[\'${{ github.event.inputs.os }}\']"
64+
python-version: "['3.6', '3.7', '3.8', '3.9', '3.10']"
65+
66+
# Run builds for selected Ubuntu and Python versions.
67+
build:
68+
if: ${{ (github.event.inputs.os != 'any') && (github.event.inputs.python-version != 'any') && (github.event.inputs.os != '') }}
69+
uses: ./.github/workflows/makeall-linux.yaml
70+
with:
71+
os: "[\'${{ github.event.inputs.os }}\']"
72+
python-version: "[\'${{ github.event.inputs.python-version }}\']"

0 commit comments

Comments
 (0)