Skip to content
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
32 changes: 24 additions & 8 deletions .github/workflows/build-binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,57 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# deny-all default; each job below grants only the scopes it needs
permissions: {}

jobs:
binaries:
runs-on: ubuntu-latest
permissions:
contents: write
strategy:
matrix:
arch: [ 'amd64', 'arm64' ]
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Set version params
id: version
shell: bash
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
echo "git_commit=$(echo ${GITHUB_SHA})" >> $GITHUB_OUTPUT
echo "git_branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
echo "git_version=${{github.event.release.tag_name}}" >> $GITHUB_OUTPUT
echo "git_version=${RELEASE_TAG}" >> $GITHUB_OUTPUT

- name: Print version params
env:
GIT_COMMIT: ${{ steps.version.outputs.git_commit }}
GIT_BRANCH: ${{ steps.version.outputs.git_branch }}
GIT_VERSION: ${{ steps.version.outputs.git_version }}
run: |
echo "Commit: ${{ steps.version.outputs.git_commit }}"
echo "Branch: ${{ steps.version.outputs.git_branch }}"
echo "Version: ${{ steps.version.outputs.git_version }}"
echo "Commit: ${GIT_COMMIT}"
echo "Branch: ${GIT_BRANCH}"
echo "Version: ${GIT_VERSION}"

- name: Set up Go
uses: actions/setup-go@v7
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: 'go.mod'
cache: false

- name: Build
run: |
GOOS=linux GOARCH=${{ matrix.arch }} go build -o nuts-linux-${{ matrix.arch }} -ldflags="-w -s -X 'github.com/nuts-foundation/nuts-node/core.GitCommit=${GIT_COMMIT}' -X 'github.com/nuts-foundation/nuts-node/core.GitBranch=${GIT_BRANCH}' -X 'github.com/nuts-foundation/nuts-node/core.GitVersion=${GIT_VERSION}'" -o nuts-linux-${{ matrix.arch }}
- name: Upload binary
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
ARCH: ${{ matrix.arch }}
run: |
gh release upload ${{ github.event.release.tag_name }} nuts-linux-${{ matrix.arch }}
gh release upload "${RELEASE_TAG}" "nuts-linux-${ARCH}"

39 changes: 26 additions & 13 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# deny-all default; each job below grants only the scopes it needs
permissions: {}

jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Set version params
id: version
Expand All @@ -31,22 +38,28 @@ jobs:
echo "git_branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
echo "git_version=$(git name-rev --tags --name-only $(git rev-parse HEAD))" >> $GITHUB_OUTPUT

- uses: actions-ecosystem/action-get-latest-tag@v1
- uses: actions-ecosystem/action-get-latest-tag@b7c32daec3395a9616f88548363a42652b22d435 # v1
id: get-latest-tag
with:
semver_only: true

- name: Print version params
env:
GIT_COMMIT: ${{ steps.version.outputs.git_commit }}
GIT_BRANCH: ${{ steps.version.outputs.git_branch }}
GIT_VERSION: ${{ steps.version.outputs.git_version }}
LATEST_TAG: ${{ steps.get-latest-tag.outputs.tag }}
THIS_TAG: ${{ github.ref }}
run: |
echo "Commit: ${{ steps.version.outputs.git_commit }}"
echo "Branch: ${{ steps.version.outputs.git_branch }}"
echo "Version: ${{ steps.version.outputs.git_version }}"
echo "Latest tag: ${{ steps.get-latest-tag.outputs.tag }}"
echo "This tag: ${{ github.ref }}"
echo "Commit: ${GIT_COMMIT}"
echo "Branch: ${GIT_BRANCH}"
echo "Version: ${GIT_VERSION}"
echo "Latest tag: ${LATEST_TAG}"
echo "This tag: ${THIS_TAG}"

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v6
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6
with:
images: nutsfoundation/nuts-node
tags: |
Expand All @@ -58,20 +71,20 @@ jobs:
latest=${{ steps.version.outputs.git_version == steps.get-latest-tag.outputs.tag }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4

- name: Login to Docker Hub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v7
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
context: .
file: Dockerfile
Expand All @@ -87,7 +100,7 @@ jobs:

- name: Build and push development image
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
uses: docker/build-push-action@v7
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
with:
context: development/dev-image
push: true
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/codeql-analysis-cron-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
schedule:
- cron: '42 21 * * 0,3'

# deny-all default; the job below grants only the scopes it needs
permissions: {}

jobs:
analyze:
name: Analyze
Expand All @@ -29,19 +32,20 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
ref: ${{ matrix.branches }}
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v7
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
# use go version from go.mod.
go-version-file: 'go.mod'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4
with:
languages: 'go'
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -52,7 +56,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
uses: github/codeql-action/autobuild@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -66,4 +70,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4
15 changes: 10 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ on:
- 'master'
- 'V*'

# deny-all default; the job below grants only the scopes it needs
permissions: {}

jobs:
analyze:
name: Analyze
Expand All @@ -41,17 +44,19 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v7
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
# use go version from go.mod.
go-version-file: 'go.mod'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -62,7 +67,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v4
uses: github/codeql-action/autobuild@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -76,4 +81,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4
31 changes: 20 additions & 11 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- master
- 'V*'

# deny-all default; each job below grants only the scopes it needs
permissions: {}

jobs:
# Docs-only changes (docs/, markdown, rst) can't affect the e2e tests. Detected once here so the
Expand All @@ -22,13 +24,16 @@ jobs:
# path filter.
changes:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
persist-credentials: false

- name: Check for non-doc changes
id: filter
Expand All @@ -46,27 +51,31 @@ jobs:
needs: changes
if: ${{ needs.changes.outputs.code == 'true' && (github.event.pull_request.merged || github.event.pull_request.head.repo.full_name == github.repository) }}
permissions:
contents: read
packages: write

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v7
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
# use go version from go.mod.
go-version-file: 'go.mod'
cache: false

- name: Set up QEMU
uses: docker/setup-qemu-action@v4
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
uses: docker/setup-buildx-action@37fe631027851001ddb9b187196cc803df7f5f0e # v4

- name: Login to ghcr.io
uses: docker/login-action@v4
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -81,7 +90,7 @@ jobs:
run: echo "SHA=${{ github.sha }}" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v7
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
if: ${{ github.actor != 'dependabot' }}
with:
context: .
Expand All @@ -95,7 +104,7 @@ jobs:
GIT_AUTH_TOKEN=${{ secrets.PACKAGE_SECRET }}

- name: Build and push dependabot
uses: docker/build-push-action@v7
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
if: ${{ github.actor == 'dependabot' }}
with:
context: .
Expand All @@ -109,12 +118,12 @@ jobs:
- name: Run E2E tests
run: |
cd e2e-tests && \
find . -type f -name "docker-compose*.yml" | xargs -I{} sed -i 's~nutsfoundation/nuts-node:master~ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }}~g' {} && \
find . -type f -name "docker-compose*.yml" | xargs -I{} sed -i "s~nutsfoundation/nuts-node:master~ghcr.io/nuts-foundation/nuts-node-ci:${SHA}~g" {} && \
find . -type f -name "run-test.sh" | xargs -I{} sed -i 's/docker-compose exec/docker-compose exec -T/g' {} && \
./run-tests.sh

- name: package cleanup
uses: dataaxiom/ghcr-cleanup-action@v1
uses: dataaxiom/ghcr-cleanup-action@d52806a0dc70b430571a37da1fde39733ffd640f # v1
continue-on-error: true # action doesn't fail when this step fails
if: ${{ github.actor != 'dependabot' }}
with:
Expand All @@ -125,7 +134,7 @@ jobs:
keep-n-tagged: 3

- name: package cleanup dependabot
uses: dataaxiom/ghcr-cleanup-action@v1
uses: dataaxiom/ghcr-cleanup-action@d52806a0dc70b430571a37da1fde39733ffd640f # v1
continue-on-error: true # action doesn't fail when this step fails
if: ${{ github.actor == 'dependabot' }}
with:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- 'V*'
pull_request:

# deny-all default; each job below grants only the scopes it needs
permissions: {}

jobs:
# Docs-only changes (docs/, markdown, rst) can't affect Go tests. Detected once here so the
# (required) test job below can skip entirely on them: that keeps the check fast and avoids
Expand All @@ -15,11 +18,13 @@ jobs:
# required status check, unlike skipping the workflow itself via a trigger-level path filter.
changes:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
code: ${{ steps.filter.outputs.code }}
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
fetch-depth: 0
Expand All @@ -45,12 +50,12 @@ jobs:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v7
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: 'go.mod'

Expand Down
Loading
Loading