From 7f4082475bae0d94887bda72583f1ddea0bf6a63 Mon Sep 17 00:00:00 2001 From: jidicula Date: Wed, 27 Jul 2022 20:14:17 -0400 Subject: [PATCH] ci(runner): Run tests on specific Ubuntu versions 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 --- .github/workflows/test-ubuntu-18.04.yml | 20 ++++++++++++++++++++ .github/workflows/test-ubuntu-20.04.yml | 20 ++++++++++++++++++++ .github/workflows/test-ubuntu-22.04.yml | 20 ++++++++++++++++++++ .github/workflows/tests.yml | 19 +++++++++---------- 4 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test-ubuntu-18.04.yml create mode 100644 .github/workflows/test-ubuntu-20.04.yml create mode 100644 .github/workflows/test-ubuntu-22.04.yml diff --git a/.github/workflows/test-ubuntu-18.04.yml b/.github/workflows/test-ubuntu-18.04.yml new file mode 100644 index 0000000..38f280b --- /dev/null +++ b/.github/workflows/test-ubuntu-18.04.yml @@ -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" diff --git a/.github/workflows/test-ubuntu-20.04.yml b/.github/workflows/test-ubuntu-20.04.yml new file mode 100644 index 0000000..ad43f3f --- /dev/null +++ b/.github/workflows/test-ubuntu-20.04.yml @@ -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" diff --git a/.github/workflows/test-ubuntu-22.04.yml b/.github/workflows/test-ubuntu-22.04.yml new file mode 100644 index 0000000..c3e6e26 --- /dev/null +++ b/.github/workflows/test-ubuntu-22.04.yml @@ -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" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 612f755..c9604c3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,12 +1,11 @@ name: Tests on: - push: - branches: - - main - pull_request: - branches: - - main + workflow_call: + inputs: + runner-os: + required: true + type: string defaults: run: @@ -14,12 +13,12 @@ defaults: 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 @@ -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 }}