forked from osbuild/images
-
Notifications
You must be signed in to change notification settings - Fork 0
100 lines (83 loc) · 3.16 KB
/
test-osbuild-composer-intergation.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
---
name: "[integration]"
on: # yamllint disable-line rule:truthy
pull_request:
branches:
- "*"
jobs:
unit-tests:
name: "🛃 osbuild-composer unit tests"
runs-on: ubuntu-20.04
container:
image: registry.fedoraproject.org/fedora:latest
steps:
# krb5-devel is needed to test internal/upload/koji package
# gcc is needed to build the mock depsolver binary for the unit tests
# gpgme-devel is needed for container upload dependencies
- name: Install build and test dependencies
run: dnf -y install krb5-devel gcc git-core go gpgme-devel osbuild-depsolve-dnf btrfs-progs-devel device-mapper-devel
- name: Check out osbuild-composer main branch
uses: actions/checkout@v4
with:
path: osbuild-composer
repository: osbuild/osbuild-composer
ref: main
- name: Check out the osbuild/images code
uses: actions/checkout@v4
with:
path: images
ref: ${{ github.event.pull_request.head.sha }}
- name: Update the osbuild/images reference
run: |
cd osbuild-composer
go mod edit -replace github.com/osbuild/images=../images
./tools/prepare-source.sh
- name: Mark the working directory as safe for git
run: git config --global --add safe.directory "$(pwd)"
- name: Run unit tests
working-directory: osbuild-composer
run: go test -v -race ./...
lint:
name: "⌨ osbuild-composer Golang Lint"
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: "1.21"
id: go
- name: Check out osbuild-composer main branch
uses: actions/checkout@v4
with:
path: osbuild-composer
repository: osbuild/osbuild-composer
ref: main
- name: Check out the osbuild/images code
uses: actions/checkout@v4
with:
path: images
ref: ${{ github.event.pull_request.head.sha }}
- name: Update the osbuild/images reference
working-directory: osbuild-composer
run: |
go mod edit -replace github.com/osbuild/images=../images
./tools/prepare-source.sh
- name: Allow replacing the osbuild/images module in .golangci.yml
working-directory: osbuild-composer
run: |
awk '/replace-local: false/ {print " replace-local: true"; print " replace-allow-list:\n - github.com/osbuild/images"; next} 1' .golangci.yml > .golangci.yml.new
mv .golangci.yml.new .golangci.yml
- name: Apt update
run: sudo apt update
# This is needed to lint internal/upload/koji package
- name: Install kerberos devel package
run: sudo apt install -y libkrb5-dev
# This is needed for the container upload dependencies
- name: Install libgpgme devel package
run: sudo apt install -y libgpgme-dev libbtrfs-dev libdevmapper-dev
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.54.2
working-directory: osbuild-composer
args: --verbose --timeout 5m0s