From fda7a167d4b04834e496d8d302e25c6fc458ebd4 Mon Sep 17 00:00:00 2001 From: Yannik Bramkamp Date: Mon, 22 Feb 2021 10:15:18 +0100 Subject: [PATCH] squash pipeline fixing --- .github/workflows/build.yaml | 5 ++++- .github/workflows/release.yaml | 4 ++++ Makefile | 4 ++-- build/ci/.golangci.yml | 1 + build/ci/.goreleaser.yml | 2 +- .../{.goreleaser_root.yml => .goreleaser_privileged.yml} | 4 ++-- build/docker/{Dockerfile_root => Dockerfile_privileged} | 0 test/pkg/source/xfstest/xfs_test.go | 7 ++++++- 8 files changed, 20 insertions(+), 7 deletions(-) rename build/ci/{.goreleaser_root.yml => .goreleaser_privileged.yml} (93%) rename build/docker/{Dockerfile_root => Dockerfile_privileged} (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index db1d4f0..0a4c370 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,6 +14,9 @@ jobs: with: go-version: 1.15 + - name: Lint + run: make lintci + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: @@ -24,7 +27,7 @@ jobs: uses: goreleaser/goreleaser-action@v2 with: version: latest - args: release --rm-dist --snapshot --skip-publish -f build/ci/.goreleaser_root.yml + args: release --rm-dist --snapshot --skip-publish -f build/ci/.goreleaser_privileged.yml test: runs-on: ubuntu-20.04 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0af6987..23b54d7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,3 +17,7 @@ jobs: - run: curl -sL https://git.io/goreleaser | bash -s -- --config build/ci/.goreleaser.yml --rm-dist env: GITHUB_TOKEN: ${{ secrets.RELEASE_USER_TOKEN }} + + - run: curl -sL https://git.io/goreleaser | bash -s -- --config build/ci/.goreleaser_privileged.yml --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_USER_TOKEN }} diff --git a/Makefile b/Makefile index aac60ea..25a9858 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ lintci: docker run --rm \ -v $(CURDIR):/app \ -w /app \ - -e GOLANGCI_ADDITIONAL_YML=/app/build/package/ci/.golangci.yml \ + -e GOLANGCI_ADDITIONAL_YML=/app/build/ci/.golangci.yml \ quay.io/mittwald/golangci-lint:0.0.8 \ golangci-lint run -v --fix ./... @@ -37,7 +37,7 @@ lint: docker run --rm \ -v $(shell go env GOPATH):/go \ -v ${CURDIR}:/app -w /app \ - -e GOLANGCI_ADDITIONAL_YML=/app/build/package/ci/.golangci.yml \ + -e GOLANGCI_ADDITIONAL_YML=/app/build/ci/.golangci.yml \ quay.io/mittwald/golangci-lint:0.0.8 \ golangci-lint run -v --fix ./... diff --git a/build/ci/.golangci.yml b/build/ci/.golangci.yml index f69bcd4..2d37021 100644 --- a/build/ci/.golangci.yml +++ b/build/ci/.golangci.yml @@ -3,5 +3,6 @@ run: skip-dirs: - test/ + - dist/ timeout: 10m diff --git a/build/ci/.goreleaser.yml b/build/ci/.goreleaser.yml index c010ac1..645c9f6 100644 --- a/build/ci/.goreleaser.yml +++ b/build/ci/.goreleaser.yml @@ -1,7 +1,7 @@ before: hooks: - go mod download - - make lintci + builds: - env: diff --git a/build/ci/.goreleaser_root.yml b/build/ci/.goreleaser_privileged.yml similarity index 93% rename from build/ci/.goreleaser_root.yml rename to build/ci/.goreleaser_privileged.yml index 39f84f1..35de274 100644 --- a/build/ci/.goreleaser_root.yml +++ b/build/ci/.goreleaser_privileged.yml @@ -1,7 +1,7 @@ before: hooks: - go mod download - - make lintci + builds: - env: @@ -43,7 +43,7 @@ dockers: - quay.io/mittwald/brudi_root:stable binaries: - brudi - dockerfile: build/docker/Dockerfile_root + dockerfile: build/docker/Dockerfile_privileged goos: linux goarch: amd64 goarm: '' \ No newline at end of file diff --git a/build/docker/Dockerfile_root b/build/docker/Dockerfile_privileged similarity index 100% rename from build/docker/Dockerfile_root rename to build/docker/Dockerfile_privileged diff --git a/test/pkg/source/xfstest/xfs_test.go b/test/pkg/source/xfstest/xfs_test.go index 2957783..19e361a 100644 --- a/test/pkg/source/xfstest/xfs_test.go +++ b/test/pkg/source/xfstest/xfs_test.go @@ -58,6 +58,9 @@ func (xfsTestSuite *XFSTestSuite) TestBasicXFSDump() { err = os.Remove(dumpName) xfsTestSuite.Require().NoError(err) + + err = os.Remove(dirName) + xfsTestSuite.Require().NoError(err) } func (xfsTestSuite *XFSTestSuite) TestXFSDumpRestic() { @@ -79,7 +82,7 @@ func (xfsTestSuite *XFSTestSuite) TestXFSDumpRestic() { dirName := fmt.Sprintf("%s/testdir", mountPoint) - os.Mkdir(dirName, 744) + err = os.Mkdir(dirName, 744) xfsTestSuite.Require().NoError(err) err = source.DoBackupForKind(ctx, "xfsdump", false, true, false) @@ -95,6 +98,8 @@ func (xfsTestSuite *XFSTestSuite) TestXFSDumpRestic() { xfsTestSuite.Require().NoError(err) err = os.Remove(dumpName) xfsTestSuite.Require().NoError(err) + err = os.Remove(dirName) + xfsTestSuite.Require().NoError(err) } func TestXFSTestSuite(t *testing.T) {