Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
# 05:00 UTC = 06:00 CET = 07:00 CEST
schedule:
- cron: "0 5 * * *"
workflow_run:
workflows: [ "Receive pull request" ]
types: [ completed ]

# Cancel previous runs that have not completed
concurrency:
Expand All @@ -23,6 +26,10 @@ env:

jobs:
pytest:
if: >
github.event_name != 'workflow_run' ||
github.event.workflow_run.conclusion == 'success'

strategy:
matrix:
os:
Expand Down Expand Up @@ -62,9 +69,18 @@ jobs:

steps:
- name: Check out message_ix
if: github.event_name != 'workflow_run'
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.depth }}

- name: Check out message_ix (workflow_run)
if: github.event_name == 'workflow_run'
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.depth }}
repository: ${{ github.event.workflow_run.repository }}
ref: ${{ github.event.workflow_run.head_branch }}

- name: Fetch tags (for setuptools-scm)
run: git fetch --tags --depth=${{ env.depth }}
Expand Down Expand Up @@ -123,6 +139,10 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

tutorials:
if: >
github.event_name != 'workflow_run' ||
github.event.workflow_run.conclusion == 'success'

strategy:
matrix:
os:
Expand All @@ -137,10 +157,18 @@ jobs:

steps:
- name: Check out message_ix
if: github.event_name != 'workflow_run'
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.depth }}

- name: Check out message_ix (workflow_run)
if: github.event_name == 'workflow_run'
uses: actions/checkout@v4
with:
repository: ${{ github.event.workflow_run.repository }}
ref: ${{ github.event.workflow_run.head_branch }}

- uses: actions/setup-python@v5
with:
python-version: "3.12"
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/receive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Receive pull request

on:
pull_request:
branches: [ main ]

env:
label: "safe to test"

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Ensure first-party branch or valid label
if: >
github.repository != github.event.pull_request.head.repo.full_name &&
! contains(github.event.pull_request.labels.*.name, env.label)
run: |
echo "Will not run \`pytest\` workflow for branch in fork without label \`${{ env.label }}\`." >>$GITHUB_STEP_SUMMARY
exit 1
Loading