mirror of
https://github.com/goreleaser/nfpm
synced 2024-06-10 18:46:11 +02:00
feat: build matrix (#305)
* feat: build matrix Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: qemu Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: buildx Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: buildx Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
parent
273b612558
commit
eff2e8270e
|
@ -9,29 +9,12 @@ on:
|
|||
pull_request:
|
||||
|
||||
jobs:
|
||||
WindowsTest:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16
|
||||
- name: Cache Go modules
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/go/pkg/mod
|
||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-go-
|
||||
- name: Run tests
|
||||
run: |
|
||||
go test -v -race -count=1 ./...
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [ ~1.16 ]
|
||||
os: [ ubuntu-latest, macos-latest, windows-latest ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
||||
steps:
|
||||
|
@ -56,26 +39,31 @@ jobs:
|
|||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
-
|
||||
name: Make Setup
|
||||
run: |
|
||||
make setup
|
||||
name: Setup
|
||||
run: make setup
|
||||
-
|
||||
name: Make CI
|
||||
run: |
|
||||
make ci
|
||||
name: Test
|
||||
run: make build test
|
||||
-
|
||||
name: Acceptance tests
|
||||
run: make acceptance
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
-
|
||||
name: Upload coverage
|
||||
uses: codecov/codecov-action@v1
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./coverage.txt
|
||||
-
|
||||
name: Docker Login
|
||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
|
||||
env:
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
@ -86,7 +74,7 @@ jobs:
|
|||
-
|
||||
name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
|
||||
with:
|
||||
version: latest
|
||||
args: release --rm-dist
|
||||
|
@ -94,6 +82,6 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
||||
-
|
||||
name: Clear
|
||||
if: always()
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
rm -f ${HOME}/.docker/config.json
|
||||
|
|
Loading…
Reference in New Issue