Skip to content

Commit d0a0a46

Browse files
authored
Restructure workflows (#597)
* protect files that workflows need to process secrets * use `pull_request_target` instead of `pull_request` trigger * upgraded to `actions/checkout@v3` * get the PR's head ref * restructure workflows
1 parent 9f47346 commit d0a0a46

File tree

2 files changed

+38
-29
lines changed

2 files changed

+38
-29
lines changed

.github/workflows/ci-live.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI Live
2+
3+
on:
4+
pull_request_target:
5+
types: [labeled]
6+
7+
jobs:
8+
test-live:
9+
runs-on: ubuntu-18.04
10+
if: contains(github.event.pull_request.labels.*.name, 'safe to test')
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
- run: make github-env
17+
env:
18+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
19+
- run: |
20+
make \
21+
-e BUILD_TARGET=runtime \
22+
-e REGISTRATION_CREDENTIALS="$GITHUB_AUTH_TOKEN" \
23+
-e LOKOLE_QUEUE_BROKER_SCHEME=azureservicebus \
24+
-e LOKOLE_RESOURCE_SUFFIX="$SUFFIX" \
25+
-e APPINSIGHTS_INSTRUMENTATIONKEY="$SUFFIX" \
26+
-e AZURITE_ACCOUNT="$TEST_AZURE_STORAGE_ACCOUNT" \
27+
-e AZURITE_KEY="$TEST_AZURE_STORAGE_KEY" \
28+
-e AZURITE_HOST="" \
29+
-e AZURITE_SECURE="True" \
30+
-e TEST_STEP_DELAY=90 \
31+
-e LIVE="True" \
32+
build start integration-tests
33+
- run: make status
34+
if: ${{ failure() }}
35+
- run: make clean-storage stop
36+
if: ${{ always() }}

.github/workflows/ci.yml

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,11 @@ on:
88
- synchronize
99

1010
jobs:
11-
test-live:
12-
runs-on: ubuntu-18.04
13-
14-
steps:
15-
- uses: actions/checkout@v2
16-
- run: make github-env
17-
env:
18-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
19-
- run: |
20-
make \
21-
-e BUILD_TARGET=runtime \
22-
-e REGISTRATION_CREDENTIALS="$GITHUB_AUTH_TOKEN" \
23-
-e LOKOLE_QUEUE_BROKER_SCHEME=azureservicebus \
24-
-e LOKOLE_RESOURCE_SUFFIX="$SUFFIX" \
25-
-e APPINSIGHTS_INSTRUMENTATIONKEY="$SUFFIX" \
26-
-e AZURITE_ACCOUNT="$TEST_AZURE_STORAGE_ACCOUNT" \
27-
-e AZURITE_KEY="$TEST_AZURE_STORAGE_KEY" \
28-
-e AZURITE_HOST="" \
29-
-e AZURITE_SECURE="True" \
30-
-e TEST_STEP_DELAY=90 \
31-
-e LIVE="True" \
32-
build start integration-tests
33-
- run: make status
34-
if: ${{ failure() }}
35-
- run: make clean-storage stop
36-
if: ${{ always() }}
37-
3811
test-local:
3912
runs-on: ubuntu-18.04
4013

4114
steps:
42-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
4316
- run: |
4417
make \
4518
-e BUILD_TARGET=runtime \
@@ -55,7 +28,7 @@ jobs:
5528
runs-on: ubuntu-18.04
5629

5730
steps:
58-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
5932
- run: |
6033
make \
6134
-e BUILD_TARGET=runtime \

0 commit comments

Comments
 (0)