Skip to content

[GHA] Add container build dependency to wait on wheels to be built #110

[GHA] Add container build dependency to wait on wheels to be built

[GHA] Add container build dependency to wait on wheels to be built #110

name: Build PyPi Wheel and Docker Container
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- 'release/[0-9]+.[0-9]+'
push:
branches:
- 'release/[0-9]+.[0-9]+'
- main
release:
types: [created, published]
schedule:
- cron: '0 0 * * *'
permissions:
id-token: write
contents: read
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# if not dev or release, will create a nightly build
env:
PRODUCTION: ${{ github.event_name == 'schedule' || github.event_name == 'release'}}
RELEASE: ${{ github.event_name =='release' || startsWith(github.base_ref, 'release/') }}
DEV: ${{ github.base_ref == 'main' && github.event_name == 'pull_request'}}
jobs:
set-outputs:
runs-on: ubuntu-latest
outputs:
dev: ${{ steps.set-outputs.outputs.dev }}
release: ${{ steps.set-outputs.outputs.release }}
steps:
- name: Set variables for workflows
id: set-outputs
run: |
echo "dev=$DEV" >> $GITHUB_OUTPUT
echo "release=$RELEASE" >> $GITHUB_OUTPUT
build-wheel-and-push:
needs: set-outputs
uses: ./.github/workflows/build-wheel.yml
with:
build-label: ubuntu-20.04
dev: ${{ needs.set-outputs.outputs.dev }}
release: ${{ needs.set-outputs.outputs.release }}
name: ${{ github.event.number }}
filename: dist/*.whl
bucket_name: nm-actions-test
python: '3.10'
secrets: inherit
test-wheel-and-push-internal:
needs: build-wheel-and-push
uses: ./.github/workflows/test-wheel-push-to-internal.yml
with:
build-label: aws-avx2-64G
whl: ${{ needs.build-wheel-and-push.outputs.wheel }}
python: '3.10'
secrets: inherit
# TODO: add nightly and release container build steps once wheel build push
# to production is automated. Removed until then.
build-container-and-push:
needs: [set-outputs, test-wheel-and-push-internal]
uses: ./.github/workflows/build-container.yml
with:
build-label: aws-avx2-64G
dev: ${{ needs.set-outputs.outputs.dev }}
release: ${{ needs.set-outputs.outputs.release }}
name: ${{ github.event.number }}
secrets: inherit