This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (68 loc) · 1.92 KB
/
test-pull-request.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
79
80
81
name: Test Pull Request
on:
pull_request:
branches:
- main
concurrency:
# only one instance of test suite per PR at one time
group: pr-${{ github.event.number }}
cancel-in-progress: true
jobs:
unit:
name: Unit Tests
runs-on: ubuntu-latest
outputs:
builders: ${{ steps.builders.outputs.builders }}
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Checkout
uses: actions/checkout@v3
- name: Run Unit Tests
run: ./scripts/unit.sh
- name: Get builders from integration.json
id: builders
run: |
source "${{ github.workspace }}/scripts/.util/builders.sh"
builders="$(util::builders::list "${{ github.workspace }}/integration.json")"
printf "Output: %s\n" "${builders}"
printf "::set-output name=builders::%s\n" "${builders}"
integration:
name: Integration Tests with Builders
runs-on: ubuntu-latest
needs: unit
strategy:
matrix:
builder: ${{ fromJSON(needs.unit.outputs.builders) }}
fail-fast: false # don't cancel all test jobs when one fails
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Checkout
uses: actions/checkout@v3
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true
- name: Run Integration Tests
run: ./scripts/integration.sh --use-token --builder ${{ matrix.builder }}
env:
GIT_TOKEN: ${{ github.token }}
roundup:
name: Integration Tests
runs-on: ubuntu-latest
needs: integration
steps:
- run: |
echo "Integration tests passed against all builders"
exit 0
upload:
name: Upload Workflow Event Payload
runs-on: ubuntu-latest
steps:
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: event-payload
path: ${{ github.event_path }}