Skip to content

Commit

Permalink
fix: make sure pytest catches files (#438)
Browse files Browse the repository at this point in the history
* make sure pytest catches files

* add shim for required test

* now with more shim
  • Loading branch information
gphorvath committed Apr 25, 2024
1 parent e96f7ee commit fe3bd9b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/pytest-shim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Catch all the things we ignore in the e2e workflow
name: pytest Skip Shim
on:
pull_request:
paths:
# Catch updates to the .github directory, unless it is the pytest related files
- ".github/**"
- "!.github/workflows/pytest.yaml"
- "!.github/workflows/pytest-shim.yaml"

# Catch docs and website things
- "**.md"
- "adr/**"
- "docs/**"
- "website/**"
- "netlify.toml"

# Catch generic github metadata files
- "CODEOWNERS"
- ".gitignore"
- "LICENSE"

# Catch LFAI-UI things
- "src/leapfrogai_ui/**"
- "packages/ui/**"

permissions:
contents: read

# This is here to act as a shim for branch protection rules to work correctly.
# This is ugly but this seems to be the best way to do this since:
# - Job names in a workflow must be unique
# - When paths are ignored not all jobs are reported to the branch protection rules
# - Multiple jobs of the same name are still required by branch protection rules

# For more info see below:
# https://github.com/orgs/community/discussions/54877
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks

# Abort prior jobs in the same workflow / PR
concurrency:
group: pytest-skip-${{ github.ref }}
cancel-in-progress: true


jobs:
pytest:
runs-on: ubuntu-latest
steps:
- name: Skipped
run: |
echo skipped
5 changes: 4 additions & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ name: pytest
on:
pull_request:
paths:
# Ignore updates to the .github directory, unless it's this current file
- "**"

# Ignore updates to the .github directory unless it is the pytest related files
- "!.github/**"
- ".github/workflows/pytest.yaml"
- ".github/workflows/pytest-shim.yaml"

# Ignore docs and website things
- "!**.md"
Expand Down

0 comments on commit fe3bd9b

Please sign in to comment.