From 5cad77c8199c386c11794f740ce9fe80c9fd4e96 Mon Sep 17 00:00:00 2001 From: Gregor Noczinski Date: Sat, 24 Aug 2024 14:49:39 +0200 Subject: [PATCH] More parallel builds --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++-------- .golangci.yml | 3 +++ .goreleaser.yaml | 1 + 3 files changed, 43 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23b9cee..2fe38d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ jobs: go-version: stable - name: Install Ubuntu dependencies + if: ${{ matrix.os == 'ubuntu-latest' }} run: sudo apt install libpam0g-dev - name: Checkout code @@ -39,14 +40,49 @@ jobs: - name: Install goveralls run: go install github.com/mattn/goveralls@latest - - name: Install Syft - uses: anchore/sbom-action/download-syft@v0.17.2 - - name: Test run: | mkdir -p var go test -v -covermode atomic "-coverprofile=var/profile.cov" ./... + - name: Send coverage + if: false + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + goveralls "-coverprofile=profile.cov" "-service=github" "-parallel" "-flagname=go-${{ matrix.os }}" + package: + name: Package + strategy: + matrix: + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Install Ubuntu dependencies + if: ${{ matrix.os == 'ubuntu-latest' }} + run: sudo apt install libpam0g-dev + + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cache + uses: actions/cache@v4 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Install Syft + uses: anchore/sbom-action/download-syft@v0.17.2 + - name: GoReleaser uses: goreleaser/goreleaser-action@v6 with: @@ -55,10 +91,3 @@ jobs: args: build --snapshot --clean env: BIFROEST_VENDOR: engity - - - name: Send coverage - if: false - env: - COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - goveralls "-coverprofile=profile.cov" "-service=github" "-parallel" "-flagname=go-${{ matrix.os }}" diff --git a/.golangci.yml b/.golangci.yml index b436c0d..c613579 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,8 @@ run: timeout: 20m + build-tags: + - without-pam + - without-yescrypt linters: enable: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d9f274d..5ea6d93 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -15,6 +15,7 @@ builds: binary: bifroest goos: - linux + - windows env: - CGO_ENABLED=0 goarch: