diff --git a/.github/workflows/test.matrix.json b/.github/workflows/test.matrix.json new file mode 100644 index 0000000..f93c316 --- /dev/null +++ b/.github/workflows/test.matrix.json @@ -0,0 +1,44 @@ +{ + "include": [ + { + "label": "Bookworm", + "deb": "debian:bookworm", + "rpm": "dummy" + }, + { + "label": "Trixie", + "deb": "debian:trixie", + "rpm": "dummy" + }, + { + "label": "Jammy", + "deb": "ubuntu:jammy", + "rpm": "dummy" + }, + { + "label": "Noble", + "deb": "ubuntu:noble", + "rpm": "dummy" + }, + { + "label": "AlmaLinux8", + "deb": "dummy", + "rpm": "almalinux:8" + }, + { + "label": "AlmaLinux9", + "deb": "dummy", + "rpm": "almalinux:9" + }, + { + "label": "AlmaLinux10", + "deb": "dummy", + "rpm": "almalinux:10" + }, + { + "label": "AmazonLinux", + "deb": "dummy", + "rpm": "amazonlinux:2023" + } + ] +} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7d83f65 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,102 @@ +name: Installation Test Suite +on: + push: + branches: + - r2 + pull_request: + workflow_dispatch: +concurrency: + group: ${{ github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true +jobs: + define-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + label: ${{ steps.set-matrix.outputs.label }} + v6: ${{ steps.set-matrix.outputs.v6 }} + v6lts: ${{ steps.set-matrix.outputs.v6lts }} + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.4' + - id: set-matrix + # See https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#example-returning-a-json-object + run: | + echo "matrix=$(cat test.matrix.json | jq --compact-output)" >> $GITHUB_OUTPUT + echo "label=$(cat test.matrix.json | jq '[.include[].label]' --compact-output)" >> $GITHUB_OUTPUT + git clone https://github.com/fluent/fluent-package-builder.git + pushd fluent-package-builder + echo "v6lts=[\"$(git tag | grep v6.0 | tail -n 1 | sed -e 's/v//')\"]" >> $GITHUB_OUTPUT + echo "v6=[\"$(git tag | grep v6 | tail -n 1 | sed -e 's/v//')\"]" >> $GITHUB_OUTPUT + popd + working-directory: .github/workflows/ + + v6_install_test: + name: Test ${{ matrix.label }} v6 + needs: [define-matrix] + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + label: ${{ fromJSON(needs.define-matrix.outputs.label) }} + include: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }} + tag: ${{ fromJSON(needs.define-matrix.outputs.v6) }} + steps: + - uses: actions/checkout@v4 + - name: Run Test ${{ matrix.label }} ${{ matrix.tag }} for v6 + run: | + REPO_TARGETS=6 DEB_TARGETS=${{ matrix.deb }} RPM_TARGETS=${{ matrix.rpm }} ./test-verify-repo.sh ${{ matrix.tag }} + + v6_lts_install_test: + name: Test ${{ matrix.label }} v6/lts + needs: [define-matrix] + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + label: ${{ fromJSON(needs.define-matrix.outputs.label) }} + include: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }} + tag: ${{ fromJSON(needs.define-matrix.outputs.v6lts) }} + steps: + - uses: actions/checkout@v4 + - name: Run Test ${{ matrix.label }} ${{ matrix.tag }} for v6/lts + run: | + REPO_TARGETS=lts/6 DEB_TARGETS=${{ matrix.deb }} RPM_TARGETS=${{ matrix.rpm }} ./test-verify-repo.sh ${{ matrix.tag }} + + v6_exp_install_test: + name: Test ${{ matrix.label }} v6/exp + needs: [define-matrix] + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + label: ${{ fromJSON(needs.define-matrix.outputs.label) }} + include: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }} + tag: ${{ fromJSON(needs.define-matrix.outputs.v6lts) }} + steps: + - uses: actions/checkout@v4 + - name: Run Test ${{ matrix.label }} for v6/exp + run: | + REPO_TARGETS=exp/6 DEB_TARGETS=${{ matrix.deb }} RPM_TARGETS=${{ matrix.rpm }} ./test-verify-repo.sh ${{ matrix.tag }} + + v6_exp_lts_install_test: + name: Test ${{ matrix.label }} v6/exp/lts + needs: [define-matrix] + runs-on: ubuntu-latest + timeout-minutes: 15 + strategy: + fail-fast: false + matrix: + label: ${{ fromJSON(needs.define-matrix.outputs.label) }} + include: ${{ fromJSON(needs.define-matrix.outputs.matrix).include }} + tag: ${{ fromJSON(needs.define-matrix.outputs.v6lts) }} + steps: + - uses: actions/checkout@v4 + - name: Run Test ${{ matrix.label }} for v6/exp/lts + run: | + REPO_TARGETS=exp/lts/6 DEB_TARGETS=${{ matrix.deb }} RPM_TARGETS=${{ matrix.rpm }} ./test-verify-repo.sh ${{ matrix.tag }}