Skip to content

Commit

Permalink
CI: Try to trigger workflows after pre_commit
Browse files Browse the repository at this point in the history
This repo needs tests
  • Loading branch information
HaoZeke committed Aug 13, 2023
1 parent 5fd1c25 commit 1f47d8b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ jobs:
with:
python-version: '3.9'
- uses: pre-commit/[email protected]
call-asv-test:
needs: pre-commit
uses: ./.github/workflows/trigger_asv.yml
with:
pr-number: "${{ github.event.pull_request.number }}"
secrets:
asv_tok: ${{ secrets.ASV_TOK }}
41 changes: 25 additions & 16 deletions .github/workflows/trigger_asv.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: Trigger asv
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
inputs:
pr-number:
required: true
type: number
secrets:
asv_tok:
required: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
buildmamba:
triggerasv:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }}
env:
GH_TOKEN: ${{ inputs.asv_tok }}
PR_NUM: ${{ inputs.pr-number }}
strategy:
fail-fast: false
matrix:
Expand All @@ -25,12 +30,16 @@ jobs:
with:
submodules: "recursive"
fetch-depth: 0
- uses: convictional/[email protected]
with:
owner: airspeed-velocity
repo: asv
github_token: ${{ secrets.ASV_TOK }}
workflow_file_name: triggered.yml
ref: master
wait_workflow: true
client_payload: '{"pr_number": "${{ github.event.pull_request.number }}"}'
- run: |
gh workflow run workflow.yml -R airspeed-velocity/asv --json '{"pr_number": "${{ inputs.pr-number }}"}'
env:
GH_TOKEN: ${{ inputs.asv_tok }}
# - uses: convictional/[email protected]
# with:
# owner: airspeed-velocity
# repo: asv
# github_token: ${{ secrets.asv_tok }}
# workflow_file_name: triggered.yml
# ref: master
# wait_workflow: true
# client_payload: '{"pr_number": "${{ inputs.pr-number }}"}'

0 comments on commit 1f47d8b

Please sign in to comment.