-
Notifications
You must be signed in to change notification settings - Fork 146
78 lines (70 loc) · 2.6 KB
/
build-wheel-and-container.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build PyPi Wheel and Docker Container
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
schedule:
- cron: '0 20 * * *'
permissions:
id-token: write
contents: read
packages: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# TODO: do we want to push to nightly everytime we push to main?
# if not dev or release, will create a nightly build; turning off release for now
env:
RELEASE: 'false'
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
test-nightly:
needs: set-outputs
if: ${{ needs.set-outputs.outputs.dev == 'false' && needs.set-outputs.outputs.release == 'false'}}
uses: ./.github/workflows/test-nightly.yml
build-wheel-and-push:
needs: [set-outputs, test-nightly]
if: ${{ always() && needs.set-outputs.outputs.dev == 'false' && needs.test-nightly.result == 'success' || always() && needs.set-outputs.outputs.dev == 'true' && needs.set-outputs.result == 'success' }}
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-publish:
needs: [set-outputs, build-wheel-and-push]
if: ${{ always() && !cancelled() && needs.build-wheel-and-push.result == 'success' }}
uses: ./.github/workflows/test-wheel-and-publish.yml
with:
build-label: ubuntu-20.04
whl: ${{ needs.build-wheel-and-push.outputs.wheel }}
python: '3.10'
dev: ${{ needs.set-outputs.outputs.dev }}
release: ${{ needs.set-outputs.outputs.release }}
secrets: inherit
build-container-and-push:
needs: [test-wheel-and-publish, set-outputs]
if: ${{ always() && !cancelled() && needs.test-wheel-and-publish.result == 'success' }}
uses: ./.github/workflows/build-container.yml
with:
build-label: k8s-eng-gpu-16G-t4-32G
dev: ${{ needs.set-outputs.outputs.dev }}
release: ${{ needs.set-outputs.outputs.release }}
name: ${{ github.event.number }}
secrets: inherit