Merge pull request #7 from reversTeam/feat/pipeline #11
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
name: GoMs CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
setup: | |
name: Set up Go | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20' | |
- name: Remove replace instruction for local dependencies | |
run: sed '/^replace github\.com/d' go.mod > go.mod.ci && mv go.mod.ci go.mod | |
- name: Run install | |
run: make install | |
lint: | |
name: Lint | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install golangci-lint | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest | |
- name: Add golangci-lint to PATH | |
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Run golangci-lint | |
run: make lint | |
test: | |
name: Test | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Test | |
run: go test ./... | |
build: | |
name: Build | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build | |
run: go build -v ./... | |
# release: | |
# name: Release | |
# needs: build | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - name: Install GoReleaser | |
# run: | | |
# curl -sL https://github.com/goreleaser/goreleaser/releases/download/v0.182.1/goreleaser_Linux_x86_64.tar.gz | tar xz -C /tmp | |
# sudo mv /tmp/goreleaser /usr/local/bin/ | |
# - name: Run GoReleaser | |
# run: goreleaser release --snapshot --rm-dist | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |