Skip to content

Commit

Permalink
test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
nhuet committed May 13, 2024
1 parent 76c4090 commit 0eb35c2
Showing 1 changed file with 6 additions and 91 deletions.
97 changes: 6 additions & 91 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,99 +18,14 @@ jobs:
get-archi:
strategy:
matrix:
os: [macos-14, macos-12, macos-14-large, macos-latest]
python-version: [3.8, 3.9, 3.10]
include:
- os: macos-latest
arch: arm64
- os: macos-12
arch: x86_64
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- run: |
uname -a
uname -m
trigger:
# store trigger reason
runs-on: ubuntu-latest
outputs:
is_release: ${{ steps.reason.outputs.is_release }}
is_push_on_default_branch: ${{ steps.reason.outputs.is_push_on_default_branch }}
is_schedule: ${{ steps.reason.outputs.is_schedule }}
steps:
- id: reason
run: |
echo "is_release=${{ startsWith(github.ref, 'refs/tags/v') }}" >> $GITHUB_OUTPUT
echo "is_push_on_default_branch=${{ (github.event_name == 'push') && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch)) }}" >> $GITHUB_OUTPUT
echo "is_schedule=${{ github.event_name == 'schedule' }}" >> $GITHUB_OUTPUT
get-release-version:
needs: trigger
runs-on: ubuntu-latest
outputs:
skdecide-version: ${{ steps.get-version.outputs.skdecide_version }}
tag-name: ${{ steps.get-version.outputs.tag_name }}
steps:
- id: get-version
if: needs.trigger.outputs.is_release == 'true'
run: |
tag_name=${GITHUB_REF/refs\/tags\//} # stripping "refs/tags/"
skdecide_version=${tag_name/v/} # stripping "v"
echo "tag_name=${tag_name}" >> $GITHUB_OUTPUT
echo "skdecide_version=${skdecide_version}" >> $GITHUB_OUTPUT
diplay-version:
needs: get-release-version
runs-on: ubuntu-latest
steps:
- run: |
echo version: ${{ needs.get-release-version.outputs.skdecide-version }}
display-trigger:
needs: trigger
runs-on: ubuntu-latest
steps:
- run: |
echo is_release=${{ needs.trigger.outputs.is_release }}
echo is_push_on_default_branch=${{ needs.trigger.outputs.is_push_on_default_branch }}
echo is_schedule=${{ needs.trigger.outputs.is_schedule }}
if ${{ needs.trigger.outputs.is_release }} == 'false'; then
echo this is not a release
fi
if ${{ needs.trigger.outputs.is_push_on_default_branch }} == 'true'; then
echo this is a push on default branch
fi
- uses: actions/setup-python@v5
with:
python-version: 3.8
- shell: python3 {0}
run: |
if "${{ needs.trigger.outputs.is_release == 'true' || needs.trigger.outputs.is_push_on_default_branch == 'true' || needs.trigger.outputs.is_schedule == 'true' }}" == "false":
print("on a dev branch")
only-on-master:
needs: [trigger]
runs-on: ubuntu-latest
if: needs.trigger.outputs.is_push_on_default_branch == 'true'
outputs:
notebooks-branch: ${{ steps.write-output.outputs.notebooks_branch }}
steps:
- id: write-output
run: |
echo "yo"
echo "notebooks_branch=toto" >> $GITHUB_OUTPUT
on-all-branches:
needs: only-on-master
runs-on: ubuntu-latest
if: always()
steps:
- run: echo yo ${{ needs.only-on-master.outputs.notebooks-branch }}

deploy-doc:
uses: ./.github/workflows/deploy-doc.yml
with:
doc-version: 0.13.0

deploy-doc-2:
uses: ./.github/workflows/deploy-doc.yml

0 comments on commit 0eb35c2

Please sign in to comment.