Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflows: composite GitHub actions #3119

Merged
merged 5 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Setup go

runs:
using: 'composite'
steps:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.22.4'
4 changes: 1 addition & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ jobs:
runs-on: charon-ci
steps:
# Config options can be found in README here: https://github.com/golangci/golangci-lint-action
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-go
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
security-events: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: ./.github/actions/setup-go
- run: go install golang.org/x/vuln/cmd/govulncheck@v1.1.0
- run: govulncheck -show=traces -test ./...
8 changes: 2 additions & 6 deletions .github/workflows/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ jobs:
runs-on: charon-ci
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: ./.github/actions/setup-go
- uses: actions/cache@v3
with:
path: |
Expand All @@ -32,9 +30,7 @@ jobs:
- uses: docker/setup-buildx-action@v2 # For compose to build images
with:
driver-opts: "image=moby/buildkit:v0.10.5" # avoid unknown/unknown arch in ghcr
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: ./.github/actions/setup-go
- uses: actions/cache@v3
with:
path: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ jobs:
with:
fetch-depth: 0 # Disable shallow checkout
- uses: actions/setup-python@v2
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: ./.github/actions/setup-go
- uses: pre-commit/action@v2.0.3

- name: notify failure
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Disable shallow checkout
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: ./.github/actions/setup-go
- run: go run . --help > cli-reference.txt
- run: go run testutil/genchangelog/main.go
- uses: softprops/action-gh-release@v1
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ jobs:
runs-on: charon-ci
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: ./.github/actions/setup-go
- uses: actions/cache@v3
with:
path: |
Expand All @@ -34,9 +32,7 @@ jobs:
- unit_tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: ./.github/actions/setup-go
- uses: actions/cache@v3
with:
path: |
Expand All @@ -61,9 +57,7 @@ jobs:
- uses: docker/setup-buildx-action@v2 # For compose to build images
with:
driver-opts: "image=moby/buildkit:v0.10.5" # avoid unknown/unknown arch in ghcr
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: ./.github/actions/setup-go
- uses: actions/cache@v3
with:
path: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/verify-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ jobs:
GITHUB_PR: ${{ toJSON(github.event.pull_request) }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.22.4'
- uses: ./.github/actions/setup-go

- name: "Verify PR"
run: go run github.com/obolnetwork/charon/testutil/verifypr
Loading