Skip to content

Commit

Permalink
Centralize Go install parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpringle committed Apr 29, 2024
1 parent 5bfef8c commit a409edd
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 50 deletions.
5 changes: 5 additions & 0 deletions .github/actions/install-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ inputs:
description: "to cache or not to cache, that is the question"
required: false
default: "true"
cache-dependency-path:
description: "forwards go actions/setup-go"
required: false


runs:
using: composite
Expand All @@ -16,3 +20,4 @@ runs:
go-version: '1.21'
check-latest: true
cache: ${{ inputs.cache }}
cache-dependency-path: ${{ inputs.cache-dependency-path }}
6 changes: 1 addition & 5 deletions .github/workflows/auto-generated-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
cache: true
uses: ./.github/actions/install-go
- shell: bash
run: scripts/mock.gen.sh
- shell: bash
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/hypersdk-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
cache: true
uses: ./.github/actions/install-go
- name: Run static analysis tests
shell: bash
run: scripts/tests.lint.sh
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/hypersdk-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
cache: true
uses: ./.github/actions/install-go
- name: Run unit tests
shell: bash
run: scripts/tests.unit.sh
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/morpheusvm-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/install-go
with:
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: |
go.sum
examples/morpheusvm/go.sum
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/tidy-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
check-latest: true
cache: true
uses: ./.github/actions/install-go
- shell: bash
run: go mod tidy
- shell: bash
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/tokenvm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ on:
branches:
- main
tags:
- "*"
- '*'
pull_request:
types: [labeled,synchronize,reopened]
types: [labeled, synchronize, reopened]

jobs:
token-wallet-release:
Expand All @@ -20,11 +20,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/install-go
with:
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: |
go.sum
examples/tokenvm/go.sum
Expand All @@ -48,11 +45,8 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/install-go
with:
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: |
go.sum
examples/tokenvm/go.sum
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/tokenvm-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/install-go
with:
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: |
go.sum
examples/tokenvm/go.sum
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/tokenvm-sync-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- main
pull_request:
types: [labeled,synchronize,reopened]
types: [labeled, synchronize, reopened]

jobs:
tokenvm-sync-tests:
Expand All @@ -20,11 +20,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/install-go
with:
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: |
go.sum
examples/tokenvm/go.sum
Expand All @@ -33,7 +30,7 @@ jobs:
shell: bash
run: scripts/run.sh
env:
MODE: "full-test"
MODE: 'full-test'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
9 changes: 3 additions & 6 deletions .github/workflows/tokenvm-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- main
pull_request:
types: [labeled,synchronize,reopened]
types: [labeled, synchronize, reopened]

jobs:
tokenvm-unit-tests:
Expand All @@ -20,11 +20,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
uses: ./.github/actions/install-go
with:
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: |
go.sum
examples/tokenvm/go.sum
Expand All @@ -51,7 +48,7 @@ jobs:
shell: bash
run: scripts/run.sh
env:
MODE: "test"
MODE: 'test'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down

0 comments on commit a409edd

Please sign in to comment.