chore(deps): update actions/cache action to v4.1.2 (#26) #231
This file contains 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
on: | |
pull_request: | |
push: | |
branches: [master] | |
jobs: | |
it-tests-use-input-default-values: | |
name: "IT Test - default inputs values should work fine on this repo" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Given the gh-action is used with default values | |
id: test-data | |
uses: ./ | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2 | |
name: Then outputs.status value must be 0 as the project itself makes use of pre-commit validation | |
with: | |
expected: 0 | |
actual: ${{ steps.test-data.outputs.status }} | |
comparison: exact | |
it-tests-use-input-extra-args: | |
name: "IT Test - custom extra-args should be honored" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Given the gh-action is used with extra-args=--help | |
id: test-data | |
uses: ./ | |
with: | |
extra-args: --help | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2.0.0 | |
name: Then outputs.logs should contain some printed documentation | |
with: | |
expected: "usage: pre-commit run" | |
actual: ${{ steps.test-data.outputs.logs }} | |
comparison: contains | |
it-tests-output-status-failure: | |
name: "IT Test - output status should be 1 given pre-commit detected some issue" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Given a pre-commit-config not correctly respected | |
id: test-data | |
uses: ./ | |
with: | |
extra-args: '--all-files' | |
config-path: '.github/tests/resources/fail-check/.pre-commit-config.yaml' | |
ignore-failure: 'true' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2.0.0 | |
name: Then outputs.status value must be 1 as there are some errors | |
with: | |
expected: 1 | |
actual: ${{ steps.test-data.outputs.status }} | |
comparison: exact | |
it-tests-output-status-success: | |
name: "IT Test - output status should be 0 given pre-commit detected no issue" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Given a pre-commit-config correctly respected | |
id: test-data | |
uses: ./ | |
with: | |
extra-args: '--all-files' | |
config-path: '.github/tests/resources/success-check/.pre-commit-config.yaml' | |
ignore-failure: 'true' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2.0.0 | |
name: Then outputs.status value must be 0 as there are no errors | |
with: | |
expected: 0 | |
actual: ${{ steps.test-data.outputs.status }} | |
comparison: exact | |
it-tests-output-logs-failure: | |
name: "IT Test - output logs should contain failures given pre-commit detected some issue" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Given a pre-commit-config not correctly respected | |
id: test-data | |
uses: ./ | |
with: | |
extra-args: '--all-files' | |
config-path: '.github/tests/resources/fail-check/.pre-commit-config.yaml' | |
ignore-failure: 'true' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2.0.0 | |
name: Then it has to contain the failure message in the outputs.logs | |
with: | |
expected: "Failed" | |
actual: ${{ steps.test-data.outputs.logs }} | |
comparison: contains | |
it-tests-output-logs-success: | |
name: "IT Test - output logs should contain no failure given pre-commit detected no issue" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Given a pre-commit-config correctly respected | |
id: test-data | |
uses: ./ | |
with: | |
extra-args: '--all-files' | |
config-path: '.github/tests/resources/success-check/.pre-commit-config.yaml' | |
ignore-failure: 'true' | |
- uses: nick-fields/assert-action@aa0067e01f0f6545c31755d6ca128c5a3a14f6bf # v2.0.0 | |
name: Then it should not contain any 'Failed' in the outputs.logs | |
with: | |
expected: "Failed" | |
actual: ${{ steps.test-data.outputs.logs }} | |
comparison: notContains | |
it-tests: | |
name: "All IT Tests have to pass" | |
runs-on: ubuntu-latest | |
if: always() | |
needs: | |
# Add your tests here so that they prevent the merge of broken changes | |
- it-tests-use-input-default-values | |
- it-tests-use-input-extra-args | |
- it-tests-output-status-failure | |
- it-tests-output-status-success | |
- it-tests-output-logs-failure | |
- it-tests-output-logs-success | |
steps: | |
- uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 | |
with: | |
jobs: ${{ toJSON(needs) }} |