Skip to content

Commit

Permalink
Merge pull request #296 from fujiwara/go-1.20
Browse files Browse the repository at this point in the history
Go 1.20
  • Loading branch information
fujiwara authored May 9, 2023
2 parents 6137ea6 + 099d2cc commit 70b2178
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ jobs:
strategy:
matrix:
go:
- 1.18
- 1.19
- "1.19"
- "1.20"
name: Build
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"
check-latest: true

- name: Check out code into the Go module directory
Expand Down
29 changes: 28 additions & 1 deletion archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,45 @@ package lambroll_test

import (
"archive/zip"
"fmt"
"os"
"testing"
"time"

"github.com/fujiwara/lambroll"
)

type zipTestSuite struct {
WorkingDir string
SrcDir string
}

func (s zipTestSuite) String() string {
return fmt.Sprintf("%s_src_%s", s.WorkingDir, s.SrcDir)
}

var createZipArchives = []zipTestSuite{
{".", "test/src"},
{"test/src/dir", "../"},
}

func TestCreateZipArchive(t *testing.T) {
for _, s := range createZipArchives {
t.Run(s.String(), func(t *testing.T) {
testCreateZipArchive(t, s)
})
}
}

func testCreateZipArchive(t *testing.T, s zipTestSuite) {
cwd, _ := os.Getwd()
os.Chdir(s.WorkingDir)
defer os.Chdir(cwd)

excludes := []string{}
excludes = append(excludes, lambroll.DefaultExcludes...)
excludes = append(excludes, []string{"*.bin", "skip/*"}...)
r, info, err := lambroll.CreateZipArchive("test/src", excludes)
r, info, err := lambroll.CreateZipArchive(s.SrcDir, excludes)
if err != nil {
t.Error("faile to CreateZipArchive", err)
}
Expand Down

0 comments on commit 70b2178

Please sign in to comment.