-
Notifications
You must be signed in to change notification settings - Fork 4
84 lines (67 loc) · 2.1 KB
/
tests.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
name: tests
on:
push:
branches: [master, main]
tags-ignore: ['**']
pull_request: {}
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs: # Docs: <https://git.io/JvxXE>
gitleaks:
name: GitLeaks
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with: {fetch-depth: 0}
- uses: gacts/gitleaks@v1 # Action page: <https://github.com/gacts/gitleaks>
build:
name: Build & test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: make
- run: ldd ./mustpl && exit 1 || true
- run: make test
build-image:
name: Build docker image (${{ matrix.platform }})
runs-on: ubuntu-20.04
services:
registry:
image: registry:2
ports: ['5000:5000']
strategy:
fail-fast: false
matrix:
platform:
- linux/386
- linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64/v8
- linux/ppc64le
- linux/s390x
steps:
- uses: actions/checkout@v3
- {uses: gacts/github-slug@v1, id: slug}
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
with: {driver-opts: network=host}
- uses: docker/build-push-action@v4 # Action page: <https://github.com/docker/build-push-action>
with:
context: .
file: Dockerfile
push: true
platforms: ${{ matrix.platform }}
build-args: VERSION=${{ steps.slug.outputs.commit-hash-short }}
tags: localhost:5000/ci/app:latest
- if: matrix.platform == 'linux/amd64'
run: docker run --rm --platform "${{ matrix.platform }}" localhost:5000/ci/app:latest --help
- run: |
docker create --name app --platform "${{ matrix.platform }}" localhost:5000/ci/app:latest
docker cp app:/bin/mustpl ./mustpl
- {uses: gacts/github-slug@v1, id: filename, with: {to-slug: 'mustpl-${{ matrix.platform }}'}}
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.filename.outputs.slug }}
path: ./mustpl