build(deps): bump coverage from 7.6.5 to 7.6.11 #360
Workflow file for this run
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
name: "Continuous Testing" | |
on: | |
push: | |
pull_request: # Need to have coverallsapp action comment in the pull_request | |
permissions: | |
contents: read | |
jobs: | |
test-script: | |
name: Script Tests | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
- name: Install Test Tool | |
id: install-bats | |
run: pip install -r ./test/requirements.txt | |
- name: Install Dependencies | |
id: install-jinja2 | |
run: pip install -r ./requirements.txt | |
- name: Test | |
id: script-test | |
# Add option `-html=report.html --self-contained-html` to pytest to get html output if need on test | |
# Add `coverage html` command to get html output on coverage if needed | |
run: | | |
pytest --cov --junitxml report.xml | |
coverage xml | |
- name: Publish Coverage Report to Coveralls.io | |
id: coverage | |
if: always() && hashFiles('coverage.xml') != '' | |
uses: coverallsapp/github-action@v2 | |
- name: Code Coverage Report | |
uses: irongut/[email protected] | |
if: always() && hashFiles('coverage.xml') != '' | |
with: | |
filename: coverage.xml | |
badge: true | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: true | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: "60 80" | |
# As irongut/CodeCoverageSummary does not support file by file mode, add it | |
# See https://github.com/irongut/CodeCoverageSummary/issues/236 | |
- name: Write Coverage to Job Summary | |
run: | | |
{ | |
cat code-coverage-results.md | |
echo "\`\`\`" | |
coverage report | |
echo "\`\`\`" | |
} > my-code-coverage-results.md | |
echo my-code-coverage-results.md >> "$GITHUB_STEP_SUMMARY" | |
- name: Add Coverage PR Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
recreate: true | |
path: my-code-coverage-results.md | |
- name: Testspace client install & config | |
id: testspace_init | |
if: always() && hashFiles('report.xml') != '' | |
uses: testspace-com/setup-testspace@v1 | |
with: | |
domain: ${{github.repository_owner}} | |
- name: Testspace push test content | |
if: always() && (steps.testspace_init.outcome == 'success') | |
run: | | |
output=$(testspace "[Unit Tests]report.xml" --link=coveralls) | |
REGEX="(https://[a-z0-9]+.testspace.com/spaces/[0-9]+/result_sets/[0-9]+)" | |
[[ $output =~ $REGEX ]] | |
result_set_link="${BASH_REMATCH[1]}" | |
echo "[TestSpace Test Result set]($result_set_link)" >> "$GITHUB_STEP_SUMMARY" | |
- name: Publish Test Results in GitHub | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: report.xml | |
check_name: "Unit Test Results" | |
test-action-matrix: | |
name: Test With Matrix | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
strategy: | |
matrix: | |
test: [1] | |
env: | |
VAR_TEST1_VALUE: mytest | |
VAR_TEST2_VALUE: isfunny | |
FILE_KEY_1_VALUE: myfile | |
FILE_KEY_2_VALUE: isused | |
TEST: integ | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
- name: Install bats | |
id: install-bats | |
run: ./test/install_bats.sh | |
- name: Prepare Test File | |
run: | | |
echo "exemple:" > test-data.yml | |
echo " FILE_KEY_1: ${{ env.FILE_KEY_1_VALUE }}" >> test-data.yml | |
echo " FILE_KEY_2: ${{ env.FILE_KEY_2_VALUE }}" >> test-data.yml | |
echo "{{ github.repository }}" > all_test.j2 | |
echo "${{ github.repository }}" > expected | |
echo "{{ github.repository_owner }}" >> all_test.j2 | |
echo "${{ github.repository_owner }}" >> expected | |
echo "{{ github.event.repository.license.key }}" >> all_test.j2 | |
echo "${{ github.event.repository.license.key }}" >> expected | |
echo "{{ job.status }}" >> all_test.j2 | |
echo "${{ job.status }}" >> expected | |
echo "{{ runner.os }}" >> all_test.j2 | |
echo "${{ runner.os }}" >> expected | |
echo "{{ strategy.job_index }}" >> all_test.j2 | |
echo "${{ strategy.job-index }}" >> expected | |
echo "{{ matrix.test }}" >> all_test.j2 | |
echo "${{ matrix.test }}" >> expected | |
echo "{{ environ('TEST') }}" >> all_test.j2 | |
echo "${{ env.TEST }}" >> expected | |
echo "{{ TEST1 }}" >> all_test.j2 | |
echo "${{ env.VAR_TEST1_VALUE }}" >> expected | |
echo "{{ TEST2 }}" >> all_test.j2 | |
echo "${{ env.VAR_TEST2_VALUE }}" >> expected | |
echo "{{ env.TEST }}" >> all_test.j2 | |
echo "${{ env.TEST }}" >> expected | |
echo "{{ exemple.FILE_KEY_1 }}" >> all_test.j2 | |
echo "${{ env.FILE_KEY_1_VALUE }}" >> expected | |
echo "{{ exemple.FILE_KEY_2 }}" >> all_test.j2 | |
echo "${{ env.FILE_KEY_2_VALUE }}" >> expected | |
echo "{{ url.URL_KEY_1 }}" >> all_test.j2 | |
echo "from_url" >> expected | |
echo "{{ url.URL_KEY_2 }}" >> all_test.j2 | |
echo "it_is_working" >> expected | |
echo "" >> all_test.j2 | |
cat all_test.j2 | |
cat expected | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT" | |
id: extract_branch | |
- name: Test Local Action | |
id: test-action | |
uses: ./ | |
with: | |
#keep_template: true | |
data_file: test-data.yml | |
data_format: yaml | |
data_url: https://raw.githubusercontent.com/${{ github.repository }}/refs/heads/${{ steps.extract_branch.outputs.branch }}/test/url_data.yml | |
data_url_format: yaml | |
variables: | | |
TEST1=${{ env.VAR_TEST1_VALUE }} | |
TEST2=${{ env.VAR_TEST2_VALUE }} | |
- name: Check If Template file is managed | |
id: test-action-result | |
run: | | |
./test/bats/bin/bats --report-formatter junit test/test_action.bats | |
- name: Testspace client install & config | |
id: testspace_init | |
if: always() && hashFiles('report.xml') != '' | |
uses: testspace-com/setup-testspace@v1 | |
with: | |
domain: ${{github.repository_owner}} | |
- name: Testspace push test content | |
if: always() && (steps.test-action-result.outcome == 'success') | |
run: | | |
testspace "[Integ Tests/With Matrix]report.xml" | |
- name: Publish Test Results in GitHub | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: report.xml | |
check_name: "Integ Test Results" | |
test-action-no-matrix: | |
name: Test Without Matrix | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
pull-requests: write | |
env: | |
VAR_TEST1_VALUE: mytest | |
VAR_TEST2_VALUE: isfunny | |
FILE_KEY_1_VALUE: myfile | |
FILE_KEY_2_VALUE: isused | |
TEST: integ | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
- name: Install bats | |
id: install-bats | |
run: ./test/install_bats.sh | |
- name: Prepare Test File | |
run: | | |
echo "exemple:" > test-data.yml | |
echo " FILE_KEY_1: ${{ env.FILE_KEY_1_VALUE }}" >> test-data.yml | |
echo " FILE_KEY_2: ${{ env.FILE_KEY_2_VALUE }}" >> test-data.yml | |
echo "{{ github.repository }}" > all_test.j2 | |
echo "${{ github.repository }}" > expected | |
echo "{{ github.repository_owner }}" >> all_test.j2 | |
echo "${{ github.repository_owner }}" >> expected | |
echo "{{ github.event.repository.license.key }}" >> all_test.j2 | |
echo "${{ github.event.repository.license.key }}" >> expected | |
echo "{{ job.status }}" >> all_test.j2 | |
echo "${{ job.status }}" >> expected | |
echo "{{ runner.os }}" >> all_test.j2 | |
echo "${{ runner.os }}" >> expected | |
echo "{{ strategy.job_index }}" >> all_test.j2 | |
echo "${{ strategy.job-index }}" >> expected | |
echo "{{ matrix.test }}" >> all_test.j2 | |
# Test ChainableUndefined | |
echo "" >> expected | |
echo "{{ environ('TEST') }}" >> all_test.j2 | |
echo "${{ env.TEST }}" >> expected | |
echo "{{ TEST1 }}" >> all_test.j2 | |
echo "${{ env.VAR_TEST1_VALUE }}" >> expected | |
echo "{{ TEST2 }}" >> all_test.j2 | |
echo "${{ env.VAR_TEST2_VALUE }}" >> expected | |
echo "{{ env.TEST }}" >> all_test.j2 | |
echo "${{ env.TEST }}" >> expected | |
echo "{{ exemple.FILE_KEY_1 }}" >> all_test.j2 | |
echo "${{ env.FILE_KEY_1_VALUE }}" >> expected | |
echo "{{ exemple.FILE_KEY_2 }}" >> all_test.j2 | |
echo "${{ env.FILE_KEY_2_VALUE }}" >> expected | |
echo "" >> all_test.j2 | |
cat all_test.j2 | |
cat expected | |
- name: Test Local Action | |
id: test-action | |
uses: ./ | |
with: | |
#keep_template: true | |
undefined_behaviour: ChainableUndefined # Use to test if undefined_behaviour is managed by the action | |
data_file: test-data.yml | |
data_format: yaml | |
variables: | | |
TEST1=${{ env.VAR_TEST1_VALUE }} | |
TEST2=${{ env.VAR_TEST2_VALUE }} | |
- name: Check If Template file is managed | |
id: test-action-result | |
run: | | |
./test/bats/bin/bats --report-formatter junit test/test_action.bats | |
- name: Testspace client install & config | |
id: testspace_init | |
if: always() && hashFiles('report.xml') != '' | |
uses: testspace-com/setup-testspace@v1 | |
with: | |
domain: ${{github.repository_owner}} | |
- name: Testspace push test content | |
if: always() && (steps.test-action-result.outcome == 'success') | |
run: | | |
testspace "[Integ Tests/Without Matrix]report.xml" | |
- name: Publish Test Results in GitHub | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: report.xml | |
check_name: "Integ Test Results" |