test: csf.pl testability suite #50
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| unit: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tests: ${{ steps.scan.outputs.tests }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: scan | |
| run: echo "tests=$(find .github/tests -name '*.t' -type f | sort | xargs -n1 basename | jq -R -s -c 'split("\n") | map(select(length > 0))')" >> "$GITHUB_OUTPUT" | |
| tests: | |
| needs: unit | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| test: ${{ fromJson(needs.unit.outputs.tests) }} | |
| name: "${{ matrix.test }}" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Perl deps for csf.t | |
| if: matrix.test == 'csf.t' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libtest-mockmodule-perl libtest-mockfile-perl | |
| - name: Install Perl deps for csf_uninitialized_warnings.t | |
| if: matrix.test == 'csf_uninitialized_warnings.t' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libtest-mockmodule-perl | |
| - run: prove -v "$(find .github/tests -name '${{ matrix.test }}' -type f)" | |
| install: | |
| name: "Install" | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ubuntu:24.04 | |
| options: --privileged | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup CSF | |
| uses: ./.github/actions/setup-csf | |
| smoke: | |
| name: "Smoke" | |
| needs: install | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ubuntu:24.04 | |
| options: --privileged | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup CSF | |
| uses: ./.github/actions/setup-csf | |
| - name: Smoke CSF | |
| uses: ./.github/actions/smoke-csf | |
| upgrade: | |
| name: "Upgrade" | |
| needs: install | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ubuntu:24.04 | |
| options: --privileged | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install OS dependencies | |
| shell: bash | |
| run: apt-get update && apt-get install -y curl perl | |
| - name: Install latest release | |
| shell: bash | |
| run: bash <(curl -sL https://csf.black.host) | |
| - name: Pre-upgrade version | |
| shell: bash | |
| run: csf -v || true | |
| - name: Upgrade from source | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| cd "$GITHUB_WORKSPACE" | |
| sh install.sh | |
| - name: Post-upgrade version | |
| shell: bash | |
| run: csf -v || true | |
| uninstall: | |
| name: "Uninstall" | |
| needs: install | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ubuntu:24.04 | |
| options: --privileged | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup CSF | |
| uses: ./.github/actions/setup-csf | |
| - name: Run uninstaller | |
| shell: bash | |
| run: | | |
| set -uo pipefail | |
| cd "$GITHUB_WORKSPACE" | |
| bash uninstall.sh | |
| compatibility: | |
| uses: ./.github/workflows/compatibility.yml |