This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (79 loc) · 2.62 KB
/
main.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
name: CI
on:
push:
branches:
- master
- 'release/**'
pull_request:
jobs:
main:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19.x
- uses: actions/checkout@v3
with:
# https://github.com/reproducible-containers/repro-get/issues/3
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- run: go test -covermode=atomic -race -v ./...
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.50.0
args: --verbose
- run: make integration
examples:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19.x
- uses: actions/checkout@v3
with:
# https://github.com/reproducible-containers/repro-get/issues/3
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- run: make && sudo make install
- name: Start Buildkit
run: |
docker run -d --name buildkitd --privileged moby/buildkit:v0.11.0
echo "BUILDKIT_HOST=docker-container://buildkitd" >> $GITHUB_ENV
docker cp buildkitd:/usr/bin/buildctl /usr/local/bin/buildctl
sleep 3
# Temporarily broken, as debian.notset.fr is down
# - run: ./hack/test-dockerfile-repro.sh ./examples/gcc
- run: ./hack/test-dockerfile-repro.sh ./examples/hello
generate:
runs-on: ubuntu-22.04
# Skip the check on the master branch, as `make generate` depends on the "latest" release on
# https://github.com/reproducible-containers/repro-get/releases .
if: github.event_name == 'pull_request'
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19.x
- uses: actions/checkout@v3
with:
# https://github.com/reproducible-containers/repro-get/issues/3
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: "Check if Dockerfile* or Makefile* was changed"
run: |
set -eux
git diff --name-only "origin/${GITHUB_BASE_REF}" | tee /tmp/gitdiff
grep -E "(Dockerfile|Makefile)" /tmp/gitdiff
id: gitdiff
continue-on-error: true
- name: "Make sure that auto-generated files are kept in sync"
if: ${{ steps.gitdiff.outcome == 'success' }}
run: |
set -eux
make
sudo make install
make generate
if [ -n "$(git status --porcelain)" ]; then
echo >&2 "Auto-generated files were manually modified?"
exit 1
fi