Skip to content

Commit

Permalink
Merge pull request tonistiigi#165 from crazy-max/fix-warning-ci
Browse files Browse the repository at this point in the history
ci: update actions to fix warnings and split jobs
  • Loading branch information
tonistiigi authored Aug 25, 2023
2 parents 0ff5373 + f2d1169 commit f098008
Showing 1 changed file with 55 additions and 31 deletions.
86 changes: 55 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,68 @@ on:
- master

jobs:
test:
validate:
runs-on: ubuntu-latest
strategy:
matrix:
GO_VERSION: ["1.19", "1.20"]
env:
GO_VERSION: ${{ matrix.GO_VERSION }}
target:
- lint
- validate-gomod
- validate-shfmt
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
name: Checkout
uses: actions/checkout@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Run
uses: docker/bake-action@v3
with:
targets: ${{ matrix.target }}

build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- build
- cross
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Build
run: |
docker buildx bake
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Test
run: |
docker buildx bake test
name: Run
uses: docker/bake-action@v3
with:
targets: ${{ matrix.target }}

test:
runs-on: ubuntu-latest
strategy:
matrix:
go_version:
- "1.19"
- "1.20"
env:
GO_VERSION: ${{ matrix.go_version }}
steps:
-
name: Linters
run: |
docker buildx bake lint validate-gomod validate-shfmt
name: Checkout
uses: actions/checkout@v3
-
name: Cross
run: |
docker buildx bake cross
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Test
uses: docker/bake-action@v3
with:
targets: test

test-macos:
runs-on: macos-latest
Expand All @@ -58,20 +90,12 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
-
name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go }}-
-
name: Test
run: |
Expand All @@ -85,10 +109,10 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: Cache Vagrant boxes
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.vagrant.d/boxes
key: ${{ runner.os }}-vagrant-${{ hashFiles('hack/Vagrantfile.freebsd13') }}
Expand Down

0 comments on commit f098008

Please sign in to comment.