From 0be1889317f22196a2a5cafa2f8f5179a84faa87 Mon Sep 17 00:00:00 2001 From: ee7 <45465154+ee7@users.noreply.github.com> Date: Mon, 31 Oct 2022 22:41:23 +0100 Subject: [PATCH] .github(workflows): add workflow to test fetch-configlet scripts (#690) Before this commit, the fetch-configlet scripts weren't tested in CI. Add a workflow to test them. The `fetch-configlet.ps1` script currently always fetches the Windows release asset, so this workflow only tests that script on Windows. Closes: #121 Refs: #361 --- .github/workflows/fetch-configlet.yml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/fetch-configlet.yml diff --git a/.github/workflows/fetch-configlet.yml b/.github/workflows/fetch-configlet.yml new file mode 100644 index 00000000..1b96ee90 --- /dev/null +++ b/.github/workflows/fetch-configlet.yml @@ -0,0 +1,51 @@ +name: Fetch configlet + +on: + push: + paths: + - scripts/fetch-configlet* + pull_request: + paths: + - scripts/fetch-configlet* + workflow_dispatch: + +jobs: + fetch_configlet: + strategy: + fail-fast: false + matrix: + include: + - os: linux + runs-on: ubuntu-22.04 + + - os: mac + runs-on: macos-12 + + - os: windows + runs-on: windows-2022 + + name: fetch-configlet-${{ matrix.os }} + runs-on: ${{ matrix.runs-on }} + steps: + - name: Checkout + uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 + + - name: Run fetch-configlet + shell: bash + run: ./scripts/fetch-configlet + + - name: Run the downloaded configlet + env: + EXT: ${{ matrix.os == 'windows' && '.exe' || '' }} + shell: bash + run: | + configlet_path="./bin/configlet${EXT}" + "${configlet_path}" --version + + - name: On Windows, also test fetch-configlet.ps1 + if: matrix.os == 'windows' + shell: pwsh + run: | + Remove-Item bin/configlet.exe + scripts/fetch-configlet.ps1 + bin/configlet.exe --version