Skip to content

Commit

Permalink
CI: update official actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdan committed Feb 19, 2024
1 parent 227a2d8 commit 06eb26f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Git push main -> dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # the push step needs a full repo, not shallow
- name: Push main branch to dev branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
packages: write
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
echo github.head_ref: ${{ github.head_ref }}
echo github.base_ref: ${{ github.base_ref }}
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Go environment
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Tidy go module
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Run staticcheck
run: |
./staticcheck/staticcheck ./... 2> staticcheck/stderr
- name: Check staticcheck stderr (this step isn't needed because we are using actions/setup-go@v3 on GitHub hosted runner)
- name: Check staticcheck stderr (this step isn't needed because we are using actions/setup-go@v5 on GitHub hosted runner)
run: |
if cat staticcheck/stderr | grep "matched no packages" ; then
echo "staticcheck step did nothing, due to https://github.com/vocdoni/vocdoni-node/issues/444"
Expand All @@ -81,9 +81,9 @@ jobs:
env:
LOG_PANIC_ON_INVALIDCHARS: true # check that log lines contains no invalid chars (evidence of format mismatch)
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: benjlevesque/[email protected] # sets env.SHA to the first 7 chars of github.sha
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- run: mkdir -p "$PWD/gocoverage-unit/"
Expand All @@ -105,15 +105,15 @@ jobs:
run: go test ./...
-cover -coverpkg=./... -covermode=count -args -test.gocoverdir="$PWD/gocoverage-unit/"
- name: Store code coverage artifact (unit)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: gocoverage-unit@${{ env.SHA }}
path: gocoverage-unit/

job_compose_test:
runs-on: [self-hosted, ci2-1]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: benjlevesque/[email protected] # sets env.SHA to the first 7 chars of github.sha
- name: Run compose script
env:
Expand All @@ -128,7 +128,7 @@ jobs:
run: |
cd dockerfiles/testsuite && ./start_test.sh
- name: Store code coverage artifact (integration)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: gocoverage-integration@${{ env.SHA }}
path: dockerfiles/testsuite/gocoverage-integration/
Expand All @@ -137,8 +137,8 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Run go build for Mac
Expand All @@ -162,10 +162,10 @@ jobs:
needs: [job_go_test, job_compose_test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: benjlevesque/[email protected] # sets env.SHA to the first 7 chars of github.sha
- uses: actions/download-artifact@v3
- uses: actions/setup-go@v4
- uses: actions/download-artifact@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
Expand All @@ -188,7 +188,7 @@ jobs:
rm -f gocoverage-unit@${{ env.SHA }}.tmp
- name: Store code coverage artifact (all, textfmt)
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: gocoverage-all-textfmt@${{ env.SHA }}
path: gocoverage-*.txt
Expand All @@ -199,9 +199,9 @@ jobs:
needs: [job_gocoverage_textfmt]
continue-on-error: true # never mark the whole CI as failed because of this job
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: benjlevesque/[email protected] # sets env.SHA to the first 7 chars of github.sha
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: gocoverage-all-textfmt@${{ env.SHA }}
- name: Send coverage to coveralls.io (unit)
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/scan_vulns_deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set myvars
id: myvars
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
echo "CONTAINER_TAG=$containertag" >> $GITHUB_OUTPUT
- name: Set up Go environment
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.22'

Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
outputs: type=docker,dest=${{ steps.myvars.outputs.CONTAINER_NAME }}-${{ steps.myvars.outputs.CONTAINER_TAG }}-oci-tar

- name: Upload Container Img Tarball as Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: ${{ steps.myvars.outputs.CONTAINER_NAME }}-${{ steps.myvars.outputs.CONTAINER_TAG }}-docker-img
Expand All @@ -113,10 +113,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go environment
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.22'

Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
TRIVY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Repo Scan Results as Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: trivy-results-repo-${{ needs.build-and-deploy.outputs.DATE_IN_SECS }}
Expand All @@ -170,10 +170,10 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Download Container Img Tarball as Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
id: container_img_tar
with:
name: ${{ needs.build-and-deploy.outputs.CONTAINER_NAME }}-${{ needs.build-and-deploy.outputs.CONTAINER_TAG }}-docker-img
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:
TRIVY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Docker Scan Results as Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: trivy-results-docker-${{ needs.build-and-deploy.outputs.DATE_IN_SECS }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install swag
run: |
curl -L https://github.com/swaggo/swag/releases/download/v1.8.12/swag_1.8.12_Linux_x86_64.tar.gz | tar -xzf -
Expand All @@ -29,7 +29,7 @@ jobs:
yq '.components.schemas."api.GenericTransactionWithInfo".properties.tx = load("api/docs/models/transactions.yaml").target' \
api/docs/oas3.yaml > api/docs/vocdoni-api.yaml
- name: Publish Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: vocdoni-api.yaml
path: api/docs/vocdoni-api.yaml
Expand All @@ -39,7 +39,7 @@ jobs:
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Checkout developer-portal repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: vocdoni/developer-portal
ref: main
Expand Down

0 comments on commit 06eb26f

Please sign in to comment.