Skip to content

Commit 64295d6

Browse files
authored
ci: use a reusable workflow, instead of waiting and counting jobs (#216)
2 parents f667b58 + 041df39 commit 64295d6

File tree

6 files changed

+59
-94
lines changed

6 files changed

+59
-94
lines changed

.github/workflows/build-packages.yml renamed to .github/workflows/Build.yml

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
name: build-packages
1+
name: Build packages
2+
23
on:
3-
push:
4-
# Prevents triggering multiple workflows in PRs. Workflows triggered from
5-
# the same commit shouldn't run simultaneously because they're overwriting
6-
# each other's packages on Anaconda.
7-
branches: [ master ]
8-
paths-ignore:
9-
- '.github/workflows/tuttest.yml'
10-
- 'README.md'
11-
pull_request:
12-
paths-ignore:
13-
- '.github/workflows/tuttest.yml'
14-
- 'README.md'
15-
workflow_dispatch:
16-
schedule:
17-
- cron: '0 23 * * *' # run daily at 23:00 (UTC)
4+
workflow_call:
5+
186
env:
197
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
208
ANACONDA_USER: ${{ secrets.ANACONDA_USER }}
21-
NUM_OF_JOBS: 68
9+
2210
defaults:
2311
run:
2412
shell: bash
13+
2514
jobs:
2615

2716
#1
@@ -775,16 +764,3 @@ jobs:
775764
steps:
776765
- uses: actions/checkout@v3
777766
- uses: ./ci
778-
779-
master-package:
780-
runs-on: "ubuntu-20.04"
781-
env:
782-
OS_NAME: "linux"
783-
steps:
784-
- uses: actions/checkout@v3
785-
- run: pip install urllib3
786-
- run: |
787-
# Required internally by the scripts to locate other scripts.
788-
export CI_SCRIPTS_PATH="$(pwd)/ci"
789-
bash $CI_SCRIPTS_PATH/install.sh
790-
python $CI_SCRIPTS_PATH/wait-for-statuses.py

.github/workflows/Upload.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Upload packages
2+
3+
on:
4+
push:
5+
# Prevents triggering multiple workflows in PRs. Workflows triggered from
6+
# the same commit shouldn't run simultaneously because they're overwriting
7+
# each other's packages on Anaconda.
8+
branches: [ master ]
9+
paths-ignore:
10+
- '.github/workflows/tuttest.yml'
11+
- 'README.md'
12+
pull_request:
13+
paths-ignore:
14+
- '.github/workflows/tuttest.yml'
15+
- 'README.md'
16+
workflow_dispatch:
17+
schedule:
18+
- cron: '0 23 * * *' # run daily at 23:00 (UTC)
19+
20+
env:
21+
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
22+
ANACONDA_USER: ${{ secrets.ANACONDA_USER }}
23+
OS_NAME: linux
24+
25+
jobs:
26+
27+
28+
Build:
29+
uses: ./.github/workflows/Build.yml
30+
31+
32+
Upload:
33+
needs: Build
34+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
35+
runs-on: ubuntu-20.04
36+
steps:
37+
- uses: actions/checkout@v3
38+
- run: |
39+
# Required internally by the scripts to locate other scripts.
40+
export CI_SCRIPTS_PATH="$(pwd)/ci"
41+
./ci/install.sh
42+
./ci/upload-packages.sh
43+
44+
45+
Cleanup:
46+
runs-on: ubuntu-20.04
47+
steps:
48+
- uses: actions/checkout@v3
49+
- run: |
50+
# Required internally by the scripts to locate other scripts.
51+
export CI_SCRIPTS_PATH="$(pwd)/ci"
52+
./ci/install.sh
53+
./ci/cleanup-anaconda.sh

ci/common.sh

100644100755
File mode changed.

ci/test_anaconda.sh

100644100755
File mode changed.
File renamed without changes.

ci/wait-for-statuses.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)