Skip to content

Commit

Permalink
Updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-astus committed Jul 19, 2024
1 parent c0244d0 commit aa8dedf
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/matrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: shared matrix
on:
workflow_call:
# Map the workflow outputs to job outputs
outputs:
os:
value: ${{ jobs.define-matrix.outputs.os }}
python:
value: ${{ jobs.define-matrix.outputs.python }}

jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
os: ${{ steps.os.outputs.os }}
python: ${{ steps.python.outputs.python }}
steps:
- name: Define OS versions
id: os
run: |
echo 'os=["ubuntu-latest"]' >> "$GITHUB_OUTPUT"
- name: Define python versions
id: python
run: |
echo 'python=["3.10"]' >> "$GITHUB_OUTPUT"
19 changes: 17 additions & 2 deletions .github/workflows/test_integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ on:
types: [ok-to-test-command]

jobs:
define-matrix:
uses: ./.github/workflows/matrix.yaml

# Branch-based pull request
integration-trusted:
runs-on: ubuntu-latest
needs: define-matrix
strategy:
fail-fast: true
matrix:
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
python-version: ${{ fromJSON(needs.define-matrix.outputs.python) }}
runs-on: ${{ matrix.os }}
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
steps:

Expand All @@ -23,7 +32,13 @@ jobs:

# Repo owner has commented /ok-to-test on a (fork-based) pull request
integration-fork:
runs-on: ubuntu-latest
needs: define-matrix
strategy:
fail-fast: true
matrix:
os: ${{ fromJSON(needs.define-matrix.outputs.os) }}
python-version: ${{ fromJSON(needs.define-matrix.outputs.python) }}
runs-on: ${{ matrix.os }}
permissions:
pull-requests: write
checks: write
Expand Down

0 comments on commit aa8dedf

Please sign in to comment.