Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar Awile committed Oct 3, 2023
1 parent 6fdeebe commit cbb8ba1
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Test CI

concurrency:
cancel-in-progress: true

on:
pull_request:
branches:
- main

jobs:
draft-pr-job-limiter:
runs-on: ubuntu-latest
outputs:
jobs: ${{ steps.draft-pr-job-limiter.outputs.jobs }}
steps:
- id: draft-pr-job-limiter
# 1. use any other condition(s) that fits your requirements
# 2. each item in the JSON array will be matched against your matrix later
# 3. here I exclude everything except ubuntu-latest + python3.7 (see matrix below)
# 4. make sure to output as single line
# 5. the default case is: exclude nothing
run:
if ${{ github.event.pull_request.draft == true }}; then # 1
# 2, 3
# {"config.build_mode": "setuptools""},
# {"matrix_eval" : "CC=gcc-9 CXX=g++-9"}
echo 'jobs=[
{"os": "ubuntu-22.04"}
]' | tr -d '[:space:]' >> $GITHUB_OUTPUT # 4
else
echo 'jobs=[]' >> $GITHUB_OUTPUT # 5
fi|
ci:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} - ${{ matrix.config.foo }}
needs: draft-pr-job-limiter
strategy:
matrix:
os: [ macOS-11, ubuntu-20.04]
config:
foo: "bar"
foo: "baz"
include:
- os: ubuntu-22.04
config:
foo: "fish"
exclude: ${{ fromJSON(needs.draft-pr-job-limiter.outputs.jobs) }}
steps:
- name: actual work
run: |
echo "doing real work here."
sleep 60
echo "done"

0 comments on commit cbb8ba1

Please sign in to comment.