Skip to content

Commit

Permalink
fix: update to use matrix
Browse files Browse the repository at this point in the history
Signed-off-by: Junjie Gao <junjiegao@microsoft.com>
  • Loading branch information
JeyJeyGao committed Feb 22, 2023
1 parent 9ebc8b7 commit de32245
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ permissions:

jobs:
build:
strategy:
matrix:
go-version: ['1.20']

name: Build
runs-on: ubuntu-latest
steps:
Expand All @@ -19,10 +23,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up Go
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: '1.20'
go-version: ${{ matrix.go-version }}
check-latest: true

- name: Goreleaser
Expand Down
25 changes: 8 additions & 17 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ name: test
on: [pull_request]

jobs:
lint:
name: "Lint"
build:
strategy:
matrix:
go-version: ['1.20']

name: "Build"
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
steps:
- name: Set up Go
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: '1.20'
go-version: ${{ matrix.go-version }}
check-latest: true
- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -22,18 +26,5 @@ jobs:
with:
version: latest
args: --fast=false

unit-test:
name: "Unit Test"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: '1.20'
check-latest: true
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Run unit tests
run: go test ./...

0 comments on commit de32245

Please sign in to comment.