Skip to content

Bump peter-evans/create-pull-request from 7.0.11 to 8.0.0 in /check-c… #678

Bump peter-evans/create-pull-request from 7.0.11 to 8.0.0 in /check-c…

Bump peter-evans/create-pull-request from 7.0.11 to 8.0.0 in /check-c… #678

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
# https://crontab.guru/#15_14_*_*_*
- cron: 15 14 * * *
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Cache Pip
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ~/.cache/pip
# invalidate the cache anytime a requirements.txt changes
key: ${{ github.workflow }}-${{ hashFiles('**/requirements.txt') }}
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '>=3.9'
- name: Install Dependencies
run: pip install --quiet -r requirements.txt -r combine-durations/requirements.txt -r template-files/requirements.txt
- name: Run Tests
run: pytest
- name: Upload Coverage
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
read-file:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Read Remote JSON
id: json
uses: ./read-file
env:
# `full_name` is the org/repo slug, extracting from `head` in case PR was opened via a fork
FULL_NAME: ${{ github.event.pull_request.head.repo.full_name || github.event.repository.full_name }}
# `head_ref` is the pull_request branch
# `ref_name` is the push/workflow_dispatch/schedule branch
REF: ${{ github.head_ref || github.ref_name }}
with:
path: https://raw.githubusercontent.com/${{ env.FULL_NAME }}/refs/heads/${{ env.REF }}/read-file/data/json.json
parser: json
- name: Read Local YAML
id: yaml
uses: ./read-file
with:
path: ./read-file/data/yaml.yaml
parser: yaml
- name: Setup Python
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '>=3.9'
- name: Run Tests
shell: python
run: |
assert '''${{ steps.json.outputs.content }}''' == '''${{ steps.yaml.outputs.content }}'''
assert '''${{ fromJSON(steps.json.outputs.content)['foo'] }}''' == '''${{ fromJSON(steps.yaml.outputs.content)['foo'] }}'''
template-files:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Template Success
id: templates-success
uses: ./template-files
with:
config: ./template-files/data/success.yml
stubs: ./template-files/data/templates
- name: Template Error
id: templates-error
continue-on-error: true
uses: ./template-files
with:
config: ./template-files/data/error.yml
stubs: ./template-files/data/templates
- name: Run Tests
run: diff --recursive .github_cache/template-files template-files/data/expected
- name: Filter Changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
code:
- 'template-files/**'
- name: Comment on PR
if: github.event_name == 'pull_request' && steps.filter.outputs.code == 'true'
uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
with:
message: |
### Template Success
> [!WARNING]
> This is what the audit looks like when the templating has no errors.
${{ steps.templates-success.outputs.summary }}
### Template Error
> [!WARNING]
> This is what the audit looks like when templating results in errors.
${{ steps.templates-error.outputs.summary }}
GITHUB_TOKEN: ${{ secrets.SANDBOX_TEMPLATE_TOKEN }}
# required check
analyze:
needs: [pytest, read-file, template-files]
if: '!cancelled()'
runs-on: ubuntu-latest
steps:
- name: Determine Success
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
id: alls-green
with:
jobs: ${{ toJSON(needs) }}
- name: Checkout our source
if: always() && github.event_name != 'pull_request' && steps.alls-green.outputs.result == 'failure'
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Report failures
if: always() && github.event_name != 'pull_request' && steps.alls-green.outputs.result == 'failure'
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.AUTO_REPORT_TEST_FAILURE }}
RUN_ID: ${{ github.run_id }}
TITLE: 🤖 Tests Failed
with:
filename: .github/TEST_FAILURE_REPORT_TEMPLATE.md
update_existing: true