Skip to content

Commit

Permalink
update workflows (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Arieh Schneier <15041913+AriehSchneier@users.noreply.github.com>
  • Loading branch information
nandakn1 and AriehSchneier authored May 17, 2023
1 parent 771578e commit 3a4dd96
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/generate-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,29 @@ on:
jobs:
generate-tag:
name: Generate tag
runs-on: ubuntu-latest
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
steps:
- name: Check out code
uses: actions/checkout@master
with:
fetch-depth: '0'

- name: Checkout github-tag-action
uses: actions/checkout@v3
with:
repository: ${{ vars.GENERATE_TAG_REPO || 'anothrNick/github-tag-action' }}
ref: ${{ vars.GENERATE_TAG_REF || '1.62.0' }}
path: ./.github/action${{ vars.GENERATE_TAG_PATH || '/github-tag-action/' }}
token: ${{ vars.GENERATE_TAG_SECRET && secrets[vars.GENERATE_TAG_SECRET] || secrets.GITHUB_TOKEN }}

# Generate tag if commit message contains #major or #patch or #patch
- name: Bump version and push tag
id: generate_tag
uses: anz-bank/github-tag-action@1.40.0
uses: ./.github/action/github-tag-action
env:
# An action in a workflow run can't trigger a new workflow run.
# When you use GITHUB_TOKEN in your actions, all of the interactions
# with the repository are on behalf of the Github-actions bot.
# When you use GITHUB_TOKEN in your actions, all of the interactions
# with the repository are on behalf of the Github-actions bot.
# The operations act by Github-actions bot cannot trigger a new workflow run.
# More details: https://help.github.com/en/actions/reference/events-that-trigger-workflows#about-workflow-events
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
27 changes: 18 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Go
on: [push, pull_request]
jobs:
on: pull_request

env:
GOPROXY: ${{ vars.GOPROXY }}

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
steps:
- name: Set up Go
uses: actions/setup-go@v3
Expand All @@ -16,14 +19,16 @@ jobs:

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.48

build:
name: Build
runs-on: ubuntu-latest
container: golang:1.19
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Check out code into the Go module directory
uses: actions/checkout@v3

Expand All @@ -32,9 +37,13 @@ jobs:

test:
name: Test
runs-on: ubuntu-latest
container: golang:1.19
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }}
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Check out code into the Go module directory
uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ linters:
- gocyclo
- gofmt
- goimports
- revive
# - revive
- gosec
- gosimple
- govet
Expand Down
1 change: 1 addition & 0 deletions errors/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const (

type Error string

//nolint:errcheck // This is assigning to _ as an error type, not ignoring an error return
var _ error = Error("")

func (p Error) Error() string {
Expand Down
1 change: 0 additions & 1 deletion parser/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ const invalidCutpoint = Cutpointdata(-1)

func (s Scope) ReplaceCutPoint(force bool) (newScope Scope, prev, replacement Cutpointdata) {
prev = s.GetCutPoint()
replacement = invalidCutpoint
if prev.valid() || force {
// TODO: What's with the random number?
replacement = Cutpointdata(rand.Int31()) //nolint:gosec
Expand Down

0 comments on commit 3a4dd96

Please sign in to comment.