Skip to content

Commit

Permalink
ci(runner): Run tests on specific Ubuntu versions
Browse files Browse the repository at this point in the history
Factors out runner OS into separate workflows that each call a shared
test matrix workflow. This allows CI status badges for each runner OS,
rather than a single status badge for all OSes.

Having a CI status badge for each supported runner OS allows
at-a-glance judgement of this Action's maintenance status.

Resolves: #106
  • Loading branch information
jidicula committed Jul 28, 2022
1 parent 24d8c5c commit cadde0e
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 10 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/test-ubuntu-18.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ubuntu-18.04

on:
push:
branches:
- main
pull_request:
branches:
- main

defaults:
run:
shell: bash

jobs:
tests:
name: ubuntu-18.04
uses: ./.github/workflows/tests.yml
with:
runner-os: "ubuntu-18.04"
20 changes: 20 additions & 0 deletions .github/workflows/test-ubuntu-20.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ubuntu-20.04

on:
push:
branches:
- main
pull_request:
branches:
- main

defaults:
run:
shell: bash

jobs:
tests:
name: ubuntu-20.04
uses: ./.github/workflows/tests.yml
with:
runner-os: "ubuntu-20.04"
20 changes: 20 additions & 0 deletions .github/workflows/test-ubuntu-22.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ubuntu-22.04

on:
push:
branches:
- main
pull_request:
branches:
- main

defaults:
run:
shell: bash

jobs:
tests:
name: ubuntu-22.04
uses: ./.github/workflows/tests.yml
with:
runner-os: "ubuntu-22.04"
19 changes: 9 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
name: Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
inputs:
runner-os:
required: true
type: string

defaults:
run:
shell: bash

jobs:
test:
name: clang-format-${{ matrix.version }}
runs-on: ubuntu-latest
name: clang-format-${{ matrix.clang-format-version }}
runs-on: ${{ inputs.runner-os }}
strategy:
fail-fast: false
matrix:
version:
clang-format-version:
- 3
- 4
- 5
Expand All @@ -35,4 +34,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Build and test the Docker image
run: test/test.sh ${{ matrix.version }}
run: test/test.sh ${{ matrix.clang-format-version }}

0 comments on commit cadde0e

Please sign in to comment.