Skip to content

get archi

get archi #144

Workflow file for this run

name: Build workflow-testing
on:
push:
branches:
- "**"
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
get-archi:
strategy:
matrix:
os: [macos-14, macos-12, macos-14-large, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- run: |
python -c "import sys; print(sys.argv[-1])" $(lscpu | grep Architecture)
echo $(python -c "import sys; print(sys.argv[-1])" $(lscpu | grep Architecture))
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 }}