Skip to content

Commit

Permalink
Update workflow actions (#1950)
Browse files Browse the repository at this point in the history
* Update workflow actions

* Checkout code before setting up go
  • Loading branch information
muXxer authored May 24, 2024
1 parent 3e60e2a commit 3ab9641
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 49 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build_HORNET.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
name: Build HORNET
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21"
id: go
go-version-file: 'go.mod'
cache: false

- name: Print Go version
run: go version

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

- name: Build HORNET
run: go build -v .
2 changes: 1 addition & 1 deletion .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build HORNET Docker image
run: docker build . --file Dockerfile --tag hornet:latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: develop

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/gendoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ jobs:
gendoc:
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21"
id: go
go-version-file: 'go.mod'
cache: false

- name: Print Go version
run: go version

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

- name: Run gendoc
working-directory: tools/gendoc
run: go mod tidy && go run main.go

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "chore(gendoc): update docs"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: golangci-lint
uses: reviewdog/action-golangci-lint@v2
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build HORNET image
run: docker build -f Dockerfile -t hornet:dev .
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Save logs as artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.TEST_NAME }}
path: integration-tests/logs
Expand All @@ -52,7 +52,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build HORNET image
run: docker build -f Dockerfile -t hornet:dev .
Expand All @@ -73,7 +73,7 @@ jobs:
- name: Save logs as artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.TEST_NAME }}
path: integration-tests/logs
Expand All @@ -85,7 +85,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build HORNET image
run: docker build -f Dockerfile -t hornet:dev .
Expand All @@ -107,7 +107,7 @@ jobs:
- name: Save logs as artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.TEST_NAME }}
path: integration-tests/logs
Expand All @@ -119,7 +119,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build HORNET image
run: docker build -f Dockerfile -t hornet:dev .
Expand All @@ -140,7 +140,7 @@ jobs:
- name: Save logs as artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.TEST_NAME }}
path: integration-tests/logs
Expand All @@ -152,7 +152,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build HORNET image
run: docker build -f Dockerfile -t hornet:dev .
Expand All @@ -173,7 +173,7 @@ jobs:
- name: Save logs as artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.TEST_NAME }}
path: integration-tests/logs
26 changes: 13 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: iotaledger/hornet
tags: |
Expand All @@ -33,13 +33,13 @@ jobs:
type=match,pattern=v(\d+.\d+),suffix=-rc,group=1,enable=${{ contains(github.ref, '-rc') }}
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }}
password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }}

- name: Build and push to Dockerhub
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
Expand All @@ -65,7 +65,7 @@ jobs:
file_path: private_tangle.tar.gz

- name: Upload private_tangle.tar.gz file
uses: Shopify/upload-to-release@v1.0.1
uses: Shopify/upload-to-release@v2
with:
name: HORNET-${{ steps.meta.outputs.version }}-private_tangle.tar.gz
path: private_tangle.tar.gz
Expand All @@ -77,17 +77,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: iotaledger/hornet-nest
tags: |
Expand All @@ -99,13 +99,13 @@ jobs:
type=match,pattern=v(\d+.\d+),suffix=-rc,group=1,enable=${{ contains(github.ref, '-rc') }}
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }}
password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }}

- name: Build and push to Dockerhub
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: ./hornet-nest
platforms: linux/amd64,linux/arm64
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/snyk-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ jobs:

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: develop

- name: Build HORNET Docker image
run: docker build . --file Dockerfile --tag hornet:latest

- name: Run Snyk to check for Golang vulnerabilities
uses: snyk/actions/golang@0.3.0
uses: snyk/actions/golang@0.4.0
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --org=gohornet --sarif-file-output=snyk-golang.sarif

- name: Run Snyk to check for Docker image vulnerabilities
uses: snyk/actions/docker@0.3.0
uses: snyk/actions/docker@0.4.0
continue-on-error: true
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test_HORNET.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ jobs:
name: Test HORNET
runs-on: self-hosted
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: "1.21"
id: go
go-version-file: 'go.mod'
cache: false

- name: Print Go version
run: go version

- name: Install Build Essential
run: sudo apt update && sudo apt install build-essential -y

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

- name: Test HORNET
uses: nick-invision/retry@v2
uses: nick-invision/retry@v3
with:
timeout_minutes: 5
max_attempts: 3
Expand Down

0 comments on commit 3ab9641

Please sign in to comment.