7
7
branches :
8
8
- main
9
9
paths :
10
- - ' go.*'
11
- - ' **/*.go'
12
- - ' Taskfile.yml'
13
- - ' Dockerfile'
14
- - ' .github/workflows/build.yml'
15
- - ' testdata/**'
10
+ - " go.*"
11
+ - " **/*.go"
12
+ - " Taskfile.yml"
13
+ - " Dockerfile"
14
+ - " .github/workflows/build.yml"
15
+ - " testdata/**"
16
16
pull_request :
17
17
paths :
18
- - ' go.*'
19
- - ' **/*.go'
20
- - ' Taskfile.yml'
21
- - ' Dockerfile'
22
- - ' .github/workflows/build.yml'
23
- - ' testdata/'
18
+ - " go.*"
19
+ - " **/*.go"
20
+ - " Taskfile.yml"
21
+ - " Dockerfile"
22
+ - " .github/workflows/build.yml"
23
+ - " testdata/"
24
24
25
25
permissions :
26
26
contents : read
@@ -36,11 +36,11 @@ jobs:
36
36
uses : caarlos0/meta/.github/workflows/ruleguard.yml@main
37
37
with :
38
38
go-version : stable
39
- args : ' -disable largeloopcopy'
39
+ args : " -disable largeloopcopy"
40
40
unit-tests :
41
41
strategy :
42
42
matrix :
43
- os : [ ubuntu-latest, macos-latest, windows-latest ]
43
+ os : [ubuntu-latest, macos-latest, windows-latest]
44
44
runs-on : ${{ matrix.os }}
45
45
steps :
46
46
- uses : actions/checkout@v3
@@ -60,11 +60,50 @@ jobs:
60
60
with :
61
61
token : ${{ secrets.CODECOV_TOKEN }}
62
62
file : ./coverage.txt
63
+ build-pkgs-on-windows :
64
+ runs-on : windows-latest
65
+ steps :
66
+ - uses : actions/checkout@v3
67
+ - uses : actions/setup-go@v4
68
+ with :
69
+ go-version : stable
70
+ - run : mkdir dist
71
+ - shell : bash
72
+ run : |
73
+ echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
74
+ - uses : actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
75
+ with :
76
+ path : dist/
77
+ key : ${{ env.sha_short }}
78
+ enableCrossOsArchive : true
79
+ - run : go run ./cmd/nfpm/... pkg -f ./testdata/acceptance/core.complex.yaml -p deb -t ./dist/foo.deb
80
+ - run : go run ./cmd/nfpm/... pkg -f ./testdata/acceptance/core.complex.yaml -p rpm -t ./dist/foo.rpm
81
+ - run : go run ./cmd/nfpm/... pkg -f ./testdata/acceptance/core.complex.yaml -p apk -t ./dist/foo.apk
82
+ - run : go run ./cmd/nfpm/... pkg -f ./testdata/acceptance/core.complex.yaml -p archlinux -t ./dist/foo.pkg.tar.zst
83
+ install-pkgs-built-on-windows :
84
+ runs-on : ubuntu-latest
85
+ needs : [build-pkgs-on-windows]
86
+ steps :
87
+ - uses : docker/setup-qemu-action@v2
88
+ - uses : actions/checkout@v3
89
+ - shell : bash
90
+ run : |
91
+ echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
92
+ - uses : actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
93
+ with :
94
+ path : dist/
95
+ key : ${{ env.sha_short }}
96
+ enableCrossOsArchive : true
97
+ - run : ls -lha dist
98
+ - run : docker run --rm --workdir /tmp -v $PWD/dist:/tmp fedora rpm -ivh foo.rpm
99
+ - run : docker run --rm --workdir /tmp -v $PWD/dist:/tmp ubuntu dpkg -i foo.deb
100
+ - run : docker run --rm --workdir /tmp -v $PWD/dist:/tmp archlinux pacman --noconfirm -U foo.pkg.tar.zst
101
+ - run : docker run --rm --workdir /tmp -v $PWD/dist:/tmp alpine apk add --allow-untrusted foo.apk
63
102
acceptance-tests :
64
103
strategy :
65
104
matrix :
66
- pkgFormat : [ deb, rpm, apk, archlinux ]
67
- pkgPlatform : [ amd64, arm64, 386, ppc64le, armv6, armv7, s390x ]
105
+ pkgFormat : [deb, rpm, apk, archlinux]
106
+ pkgPlatform : [amd64, arm64, 386, ppc64le, armv6, armv7, s390x]
68
107
runs-on : ubuntu-latest
69
108
env :
70
109
DOCKER_CLI_EXPERIMENTAL : " enabled"
0 commit comments