Test GitHub app #40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Hello World | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: # allows triggering the workflow run manually | |
| workflow_call: | |
| inputs: | |
| json_vars: | |
| type: string | |
| description: 'A JSON string of key-value pairs that will be passed as environment variables to the workflow. (e.g., {"NAME": "test", "VERSION": "1.2.3"})' | |
| required: false | |
| default: '{}' | |
| permissions: {} | |
| jobs: | |
| build: | |
| runs-on: linux-x86-n2-16 | |
| container: 'us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build:latest' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Parse and set dynamic env vars | |
| run: | | |
| echo "Setting environment variables from input..." | |
| echo '${{ inputs.json_vars }}' | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> $GITHUB_ENV | |
| - name: Simulate build | |
| run: | | |
| echo $GITHUB_ENV | |
| echo $TEST | |
| echo "Building the project..." | |
| sleep 10 | |
| echo "Build complete." | |
| test: | |
| runs-on: linux-arm64-t2a-16 | |
| container: 'us-docker.pkg.dev/ml-oss-artifacts-published/ml-public-container/ml-build-arm64:latest' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Intermediate step | |
| run: | | |
| echo "Running tests." | |
| sleep 15 | |
| echo "Tests complete.." | |
| - name: Simulate testing | |
| run: | | |
| echo "Running tests." | |
| sleep 15 | |
| echo "Tests complete." |