Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Go

Go #28463

Workflow file for this run

name: Go
on:
schedule:
- cron: "0 */1 * * *"
- cron: "0 0 * * *"
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {}
jobs:
commit:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.event_name == 'push'
steps:
- id: check
continue-on-error: true
uses: prince-chrismc/check-actor-permissions-action@v3
with:
github_token: ${{ github.token }}
permission: write
- uses: actions/setup-go@v5
with:
go-version: ^1.19
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: go get -v -t -d ./...
- run: go test -race -coverprofile=coverage.out -covermode=atomic -v ./...
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.out
- if: steps.check.outputs.permitted == 'false'
run: |
go run ./cmd/cpr -d -t ${{ github.token }}
go run ./cmd/tir -d -t ${{ github.token }}
go run ./cmd/ovm -d -t ${{ github.token }}
- if: steps.check.outputs.permitted == 'true'
run: |
go run ./cmd/cpr -d -t ${{ secrets.REPO_PAT }}
go run ./cmd/tir -d -t ${{ secrets.REPO_PAT }}
go run ./cmd/ovm -d -t ${{ secrets.REPO_PAT }}
run:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/setup-go@v5
with:
go-version: ^1.19
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-
- run: go get -v -t -d ./...
- run: go run ./cmd/cpr -t ${{ secrets.REPO_PAT }} -i ${{ vars.ISSUE_NUMBER }}
- if: ${{ github.event_name == 'workflow_dispatch' || github.event.schedule == '0 0 * * *' }}
run: go run ./cmd/tir -t ${{ secrets.REPO_PAT }}
- if: ${{ github.event_name == 'workflow_dispatch' || github.event.schedule == '0 0 * * *' }}
run: go run ./cmd/ovm -t ${{ secrets.REPO_PAT }}
golangci:
if: github.event_name == 'pull_request' || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v3
staticcheck:
if: github.event_name == 'pull_request' || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dominikh/[email protected]