Skip to content

Commit

Permalink
testing reusable workflow (cont'd)
Browse files Browse the repository at this point in the history
  • Loading branch information
olivier-roussel committed Jan 9, 2025
1 parent e775666 commit 0c9e63d
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 4 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/build_publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
package-name:
required: true
type: string
os:
required: true
type: string
# os:
# required: true
# type: string
platform:
required: true
type: string
Expand All @@ -23,9 +23,34 @@ on:
required: true

jobs:
get-env-vars:
env:
TARGET_PLATFORM: >
${{ github.event.inputs.platform }}
TARGET_RUNNER: >
${{ fromJson('{
"linux-64": "ubuntu-latest",
"osx-64": "macos-13",
"win-64": "windows-latest"
}')[github.event.inputs.platform] }}
runs-on: ubuntu-latest
outputs:
target_runner: ${{ steps.init.outputs.target_runner }}
steps:
- name: Get env vars
id: init
run: |
echo "github.event.inputs.platform: ${{ github.event.inputs.platform }}"
echo "inputs.platform: ${{ inputs.platform }}"
echo "TARGET_PLATFORM: $TARGET_PLATFORM"
echo "target_runner: $TARGET_RUNNER"
echo "target_runner=$TARGET_RUNNER" >> $GITHUB_OUTPUT
build-publish-sofa:
needs: get-env-vars
name: "Build and publish ${{ inputs.package-name }} - ${{ inputs.platform }} conda packages for ${{ inputs.os }}"
runs-on: ${{ inputs.os }}
# runs-on: ${{ inputs.os }}
runs-on: ${{ needs.get-env-vars.outputs.target_runner}}

steps:
- uses: actions/checkout@v4
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/sofa-python3-py38.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: sofa-python3-py38
on:
workflow_dispatch:
inputs:
platform:
description: "Platform"
required: true
type: choice
options:
- '["linux-64", "osx-64", "win-64"]'
- '["linux-64"]'
- '["osx-64"]'
- '["win-64"]'
# env:
# TARGET_RUNNER: >
# ${{ fromJson('{
# "linux-64": "ubuntu-latest",
# "osx-64": "macos-13",
# "win-64": "windows-latest"
# }')[github.event.inputs.platform] }}
jobs:
# get-env-vars:
# runs-on: ubuntu-latest
# outputs:
# target_runner: ${{ steps.init.outputs.target_runner }}
# steps:
# - name: Pass env vars to the reusable workflow
# id: init
# run: |
# echo "target_runner=${{ env.TARGET_RUNNER }}" >> $GITHUB_OUTPUT
build-publish-sofa-python3-py38:
# needs: get-env-vars
uses: ./.github/workflows/build_publish_package.yml
with:
package-name: sofa-python3
# os: ubuntu-latest
# os: ${{ needs.get-env-vars.outputs.target_runner }}
platform: ${{ github.event.inputs.platform }}
python: python-3.8
anaconda-channel: sofa-framework-prerelease
secrets:
anaconda-token: ${{ secrets.ANACONDA_PRERELEASE_TOKEN }}
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 0c9e63d

Please sign in to comment.