Skip to content

Commit

Permalink
syncs unit testing workflow setup with e2e setup
Browse files Browse the repository at this point in the history
Signed-off-by: James Kunstle <[email protected]>
  • Loading branch information
JamesKunstle committed Jan 24, 2025
1 parent 8f58212 commit f3b7424
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,33 @@ name: "Run unit tests via Tox::pytest"
# to verify integration correctness.

on:
pull_request:
types: [opened, reopened, synchronize]
# run against every merge commit to 'main' and release branches
push:
branches:
- "main"
- "release-**"
- main
- release-*
# only run on PRs that touch certain regex paths
pull_request_target:
branches:
- main
- release-*
paths:
# note this should match the merging criteria in 'mergify.yml'
- "**.py"
- "pyproject.toml"
- "requirements**.txt"
- ".github/workflows/unit-test.yml" # This workflow

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

defaults:
run:
shell: bash

env:
pytest_mark: "fast"
Expand Down Expand Up @@ -64,9 +85,10 @@ jobs:
needs:
- start-ec2-runner
runs-on: ${{needs.start-ec2-runner.outputs.label}}
# This job MUST HAVE NO PERMISSIONS and no access to any secrets
# because it'll run incoming user code without discretion.
permissions: {} # this syntax disables permissions for all available options.
# It is important that this job has no write permissions and has
# no access to any secrets. This part is where we are running
# untrusted code from PRs.
permissions: {}
steps:
- name: "Harden runner"
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.1
Expand Down

0 comments on commit f3b7424

Please sign in to comment.