-
Notifications
You must be signed in to change notification settings - Fork 203
103 lines (90 loc) · 2.79 KB
/
test_pr.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: test:pr
on:
pull_request:
repository_dispatch:
types: ["test:pr"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
detect-changes:
runs-on: ubuntu-22.04
timeout-minutes: 10
permissions:
pull-requests: read
outputs:
workflow_proceed: ${{ steps.changes.outputs.workflow_proceed }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Detect changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
workflow_proceed:
- 'go.mod'
- 'Taskfile.dist.yaml'
- '.github/**'
- 'cmd/werf/**'
- 'pkg/**'
- 'integration/**'
- 'scripts/**'
- 'test/**'
lint:
needs: detect-changes
uses: ./.github/workflows/_lint.yml
with:
forceSkip: ${{ github.event_name == 'pull_request' && needs.detect-changes.outputs.workflow_proceed == 'false' }}
unit:
needs: detect-changes
uses: ./.github/workflows/_test_unit.yml
with:
excludePackages: cmd/werf/docs
forceSkip: ${{ github.event_name == 'pull_request' && needs.detect-changes.outputs.workflow_proceed == 'false' }}
build:
if: ${{ !(github.event_name == 'pull_request' && needs.detect-changes.outputs.workflow_proceed == 'false') }}
needs: detect-changes
strategy:
fail-fast: false
runs-on: ubuntu-latest-16-cores
timeout-minutes: 60
steps:
- name: Install werf build dependencies
run: |
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu libbtrfs-dev file
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
cache: true
go-version-file: go.mod
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: task -p build:dev:all
e2e_simple:
needs: detect-changes
uses: ./.github/workflows/_test_e2e_regular.yml
with:
scope: simple
forceSkip: ${{ github.event_name == 'pull_request' && needs.detect-changes.outputs.workflow_proceed == 'false' }}
secrets: inherit
notify:
if: |
(github.event_name == 'pull_request' && github.event.pull_request.draft == false && failure()) ||
(github.event_name != 'pull_request' && failure())
needs:
- lint
- unit
- e2e_simple
uses: ./.github/workflows/_notification.yml
secrets:
mentionGroupID: ${{ secrets.SLACK_MENTION_GROUP_ID }}
mapSlackUsers: ${{ secrets.SLACK_USERS_MAP }}
webhook: ${{ secrets.SLACK_WEBHOOK }}