-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: create separate CI files for
dev
and master
This commit creates separate CI files for `dev` and `master`, enhancing efficiency.
- Loading branch information
1 parent
9bddb50
commit 83ed685
Showing
2 changed files
with
64 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Dev CI | ||
permissions: | ||
contents: read | ||
on: | ||
push: | ||
branches: [dev] | ||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
strategy: | ||
matrix: | ||
go: ['stable', 'oldstable'] | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
- name: Cache Go Modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/go/bin | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Install Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Go Format | ||
run: | | ||
gofmt -s -w . | ||
if [ -n "$(git diff --exit-code)" ]; then | ||
echo "::warning::there are uncommitted changes after running go fmt" | ||
fi | ||
- name: Go Vet | ||
run: go vet ./... | ||
- name: Go Tidy | ||
run: go mod tidy | ||
- name: Go Mod Download | ||
run: go mod download | ||
- name: Go Mod Verify | ||
run: go mod verify | ||
- name: Go Generate | ||
run: | | ||
go generate ./... | ||
if [ -n "$(git diff --exit-code)" ]; then | ||
echo "::warning::there are uncommitted changes after running go generate" | ||
fi | ||
- name: Go Test | ||
run: go test -v -count=1 -race -shuffle=on -coverprofile=coverage.txt ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters