forked from bluntelk/plane.watch
-
Notifications
You must be signed in to change notification settings - Fork 1
114 lines (103 loc) · 2.86 KB
/
on_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
104
105
106
107
108
109
110
111
112
113
114
---
name: Test Container Builds
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
hadolint:
name: Hadolint (Dockerfiles)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hadolint/[email protected]
name: pw_discord_bot
with:
dockerfile: docker/pw_discord_bot/Dockerfile
ignore: [DL3007, DL3059]
format: tty
- uses: hadolint/[email protected]
name: pw_atc_api
with:
dockerfile: docker/pw_atc_api/Dockerfile
ignore: [DL3007, DL3059]
format: tty
- uses: hadolint/[email protected]
name: pw_ingest
with:
dockerfile: docker/pw_ingest/Dockerfile
ignore: [DL3007, DL3059]
format: tty
- uses: hadolint/[email protected]
name: pw_router
with:
dockerfile: docker/pw_router/Dockerfile
ignore: [DL3007, DL3059]
format: tty
- uses: hadolint/[email protected]
name: pw_ws_broker
with:
dockerfile: docker/pw_ws_broker/Dockerfile
ignore: [DL3007, DL3059]
format: tty
gochecks:
name: Go Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '1.18'
check-latest: true
- name: go vet
run: go vet -v ./...
- name: go test
run: go test -v ./...
- name: go test (with race detection)
run: go test -v -race ./...
test_build:
name: Test Build
runs-on: ubuntu-latest
needs: [hadolint, gochecks]
strategy:
matrix:
image:
- pw_discord_bot
- pw_atc_api
- pw_ingest
- pw_router
- pw_ws_broker
arch:
- linux/amd64
- linux/arm64
steps:
# Check out our code
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Get metadata from repo
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.GHCR_REGISTRY }}/${{ env.IMAGE_NAME }}
# Set up QEMU for multi-arch builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# Set up buildx for multi platform builds
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
# Test Build
- name: Test Build - ${{ matrix.image }}
uses: docker/build-push-action@v2
with:
context: .
file: docker/${{ matrix.image }}/Dockerfile
no-cache: true
platforms: ${{ matrix.arch }}
push: false
tags: test_${{ matrix.image }}_${{ matrix.arch }}
labels: ${{ steps.meta.outputs.labels }}