Skip to content

Commit

Permalink
fix: deb and apk: s390
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Nov 14, 2021
1 parent 1846234 commit 9f941b9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
matrix:
go-version: [ 1.17 ]
pkgFormat: [ deb, rpm, apk ]
pkgPlatform: [ amd64, arm64, 386, ppc64le, armv6, armv7 ]
pkgPlatform: [ amd64, arm64, 386, ppc64le, armv6, armv7, s390x ]
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: "enabled"
Expand Down
64 changes: 32 additions & 32 deletions acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (

// nolint: gochecknoglobals
var formatArchs = map[string][]string{
"apk": {"amd64", "arm64", "386", "ppc64le", "armv6", "armv7"},
"deb": {"amd64", "arm64", "ppc64le", "armv6", "armv7"},
"apk": {"amd64", "arm64", "386", "ppc64le", "armv6", "armv7", "s390x"},
"deb": {"amd64", "arm64", "ppc64le", "armv6", "armv7", "s390x"},
"rpm": {"amd64", "arm64", "ppc64le", "armv7"},
}

Expand All @@ -42,13 +42,13 @@ func TestCore(t *testing.T) {
for _, name := range testNames {
for format, architecture := range formatArchs {
for _, arch := range architecture {
func(tt *testing.T, testName, testFormat, testArch string) {
tt.Run(fmt.Sprintf("%s/%s/%s", testFormat, testArch, testName), func(ttt *testing.T) {
ttt.Parallel()
func(t *testing.T, testName, testFormat, testArch string) {
t.Run(fmt.Sprintf("%s/%s/%s", testFormat, testArch, testName), func(t *testing.T) {
t.Parallel()
if testArch == "ppc64le" && os.Getenv("NO_TEST_PPC64LE") == "true" {
ttt.Skip("ppc64le arch not supported in pipeline")
t.Skip("ppc64le arch not supported in pipeline")
}
accept(ttt, acceptParms{
accept(t, acceptParms{
Name: fmt.Sprintf("%s_%s", testName, testArch),
Conf: fmt.Sprintf("core.%s.yaml", testName),
Format: testFormat,
Expand All @@ -73,11 +73,11 @@ func TestUpgrade(t *testing.T) {
for _, name := range testNames {
for format, architecture := range formatArchs {
for _, arch := range architecture {
func(tt *testing.T, testName, testFormat, testArch string) {
tt.Run(fmt.Sprintf("%s/%s/%s", testFormat, testArch, testName), func(ttt *testing.T) {
ttt.Parallel()
func(t *testing.T, testName, testFormat, testArch string) {
t.Run(fmt.Sprintf("%s/%s/%s", testFormat, testArch, testName), func(t *testing.T) {
t.Parallel()
if testArch == "ppc64le" && os.Getenv("NO_TEST_PPC64LE") == "true" {
ttt.Skip("ppc64le arch not supported in pipeline")
t.Skip("ppc64le arch not supported in pipeline")
}

arch := strings.ReplaceAll(testArch, "armv", "arm/")
Expand Down Expand Up @@ -112,7 +112,7 @@ func TestUpgrade(t *testing.T) {
info.Target = target
require.NoError(t, pkg.Package(nfpm.WithDefaults(info), f))

accept(ttt, acceptParms{
accept(t, acceptParms{
Name: fmt.Sprintf("%s_%s.v2", testName, testArch),
Conf: fmt.Sprintf("%s.v2.yaml", testName),
Format: testFormat,
Expand All @@ -136,13 +136,13 @@ func TestRPMCompression(t *testing.T) {
compressFormats := []string{"gzip", "xz", "lzma"}
for _, arch := range formatArchs[format] {
for _, compFormat := range compressFormats {
func(tt *testing.T, testCompFormat, testArch string) {
tt.Run(fmt.Sprintf("%s/%s/%s", format, testArch, testCompFormat), func(ttt *testing.T) {
ttt.Parallel()
func(t *testing.T, testCompFormat, testArch string) {
t.Run(fmt.Sprintf("%s/%s/%s", format, testArch, testCompFormat), func(t *testing.T) {
t.Parallel()
if testArch == "ppc64le" && os.Getenv("NO_TEST_PPC64LE") == "true" {
ttt.Skip("ppc64le arch not supported in pipeline")
t.Skip("ppc64le arch not supported in pipeline")
}
accept(ttt, acceptParms{
accept(t, acceptParms{
Name: fmt.Sprintf("%s_compression_%s", testCompFormat, testArch),
Conf: fmt.Sprintf("rpm.%s.compression.yaml", testCompFormat),
Format: format,
Expand All @@ -165,13 +165,13 @@ func TestDebCompression(t *testing.T) {
compressFormats := []string{"gzip", "xz", "none"}
for _, arch := range formatArchs[format] {
for _, compFormat := range compressFormats {
func(tt *testing.T, testCompFormat, testArch string) {
tt.Run(fmt.Sprintf("%s/%s/%s", format, testArch, testCompFormat), func(ttt *testing.T) {
ttt.Parallel()
func(t *testing.T, testCompFormat, testArch string) {
t.Run(fmt.Sprintf("%s/%s/%s", format, testArch, testCompFormat), func(t *testing.T) {
t.Parallel()
if testArch == "ppc64le" && os.Getenv("NO_TEST_PPC64LE") == "true" {
ttt.Skip("ppc64le arch not supported in pipeline")
t.Skip("ppc64le arch not supported in pipeline")
}
accept(ttt, acceptParms{
accept(t, acceptParms{
Name: fmt.Sprintf("%s_compression_%s", testCompFormat, testArch),
Conf: fmt.Sprintf("deb.%s.compression.yaml", testCompFormat),
Format: format,
Expand All @@ -196,13 +196,13 @@ func TestRPMSpecific(t *testing.T) {
}
for _, name := range testNames {
for _, arch := range formatArchs[format] {
func(tt *testing.T, testName, testArch string) {
tt.Run(fmt.Sprintf("%s/%s/%s", format, testArch, testName), func(ttt *testing.T) {
ttt.Parallel()
func(t *testing.T, testName, testArch string) {
t.Run(fmt.Sprintf("%s/%s/%s", format, testArch, testName), func(t *testing.T) {
t.Parallel()
if testArch == "ppc64le" && os.Getenv("NO_TEST_PPC64LE") == "true" {
ttt.Skip("ppc64le arch not supported in pipeline")
t.Skip("ppc64le arch not supported in pipeline")
}
accept(ttt, acceptParms{
accept(t, acceptParms{
Name: fmt.Sprintf("%s_%s", testName, testArch),
Conf: fmt.Sprintf("%s.%s.yaml", format, testName),
Format: format,
Expand All @@ -228,13 +228,13 @@ func TestDebSpecific(t *testing.T) {
}
for _, name := range testNames {
for _, arch := range formatArchs[format] {
func(tt *testing.T, testName, testArch string) {
tt.Run(fmt.Sprintf("%s/%s/%s", format, testArch, testName), func(ttt *testing.T) {
ttt.Parallel()
func(t *testing.T, testName, testArch string) {
t.Run(fmt.Sprintf("%s/%s/%s", format, testArch, testName), func(t *testing.T) {
t.Parallel()
if testArch == "ppc64le" && os.Getenv("NO_TEST_PPC64LE") == "true" {
ttt.Skip("ppc64le arch not supported in pipeline")
t.Skip("ppc64le arch not supported in pipeline")
}
accept(ttt, acceptParms{
accept(t, acceptParms{
Name: fmt.Sprintf("%s_%s", testName, testArch),
Conf: fmt.Sprintf("%s.%s.yaml", format, testName),
Format: format,
Expand Down
1 change: 1 addition & 0 deletions apk/apk.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var archToAlpine = map[string]string{
"arm7": "armv7",
"arm64": "aarch64",
"ppc64le": "ppc64le",
"s390": "s390x",
}

func ensureValidArch(info *nfpm.Info) *nfpm.Info {
Expand Down
1 change: 1 addition & 0 deletions deb/deb.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var archToDebian = map[string]string{
"mipsle": "mipsel",
"mips64le": "mips64el",
"ppc64le": "ppc64el",
"s390": "s390x",
}

func ensureValidArch(info *nfpm.Info) *nfpm.Info {
Expand Down

0 comments on commit 9f941b9

Please sign in to comment.