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
36 changes: 24 additions & 12 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build and Test

# Set environment variables available in all jobs and steps
env:
go_version: "1.25.5"
python_version: "3.10"
go_version: "1.27.3"
python_version: "3.11"

on:
workflow_call:
Expand All @@ -14,6 +14,10 @@ on:

jobs:
build-and-test:
permissions:
contents: read
checks: write
pull-requests: write
strategy:
matrix:
#FIXME os: [ubuntu-latest, macOS-latest, windows-latest]
Expand All @@ -31,7 +35,7 @@ jobs:
steps:
# we want the head of the branch that triggered this, not the reference of the commit, this is so we get updated go versions etc.
- name: Check out [${{ inputs.branch || github.ref }}]
uses: actions/checkout@v6.0.2
uses: actions/checkout@v7.0.1
with:
ref: ${{ inputs.branch || github.ref }}
- name: Update Go env version
Expand All @@ -40,9 +44,11 @@ jobs:
NEW_GO_VERSION=$(cat .github/workflows/build-and-test.yml | grep '^ go_version:' | awk '{ print $2 }' | tr -d '"')
echo "go_version=$NEW_GO_VERSION" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v6
uses: actions/setup-go@v7
with:
go-version: ${{ env.go_version }}
- name: Sync workspace
uses: ARM-software/golang-utils/actions/sync-go-workspace@v1.172.0

- if: ${{ startsWith(matrix.os, 'macOS') }}
run: echo "CACHE_PATH=${{ env.go_cache_macOS_path }}" >> $GITHUB_ENV
Expand All @@ -51,7 +57,7 @@ jobs:
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: echo "CACHE_PATH=${{ env.go_cache_ubuntu_path }}" >> $GITHUB_ENV
- name: Load Go Dependency Cache
uses: actions/cache@v5
uses: actions/cache@v6
with:
path: |
${{ env.CACHE_PATH }}
Expand All @@ -64,11 +70,11 @@ jobs:
env:
GIT_TOKEN: ${{ secrets.GIT_SECRET }}
- name: Build ${{ matrix.go-module }} on ${{ matrix.os }}
run: |
cat go.mod
go mod download
go build -v ./...
working-directory: ${{ matrix.go-module }}
uses: ARM-software/golang-utils/actions/run-go-modules@v1.172.0
with:
task: build
modules: ./${{ matrix.go-module }}
build-tags: ""
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
name: Linting
uses: golangci/golangci-lint-action@v9
Expand All @@ -77,6 +83,12 @@ jobs:
version: latest
working-directory: ${{ matrix.go-module }}
args: "--verbose --output.text.print-issued-lines --output.text.print-linter-name --output.tab.colors --max-issues-per-linter 0 --max-same-issues 0"
- name: Set up gotestsum
uses: ARM-software/golang-utils/actions/setup-gotestsum@v1.172.0
- name: Test ${{ matrix.go-module }} on ${{ matrix.os }}
run: go test -race -cover -v ./...
working-directory: ${{ matrix.go-module }}
uses: ARM-software/golang-utils/actions/test-go-modules@v1.172.0
with:
modules: ./${{ matrix.go-module }}
build-tags: ""
artifact-prefix: "${{ matrix.go-module }}-${{ matrix.os }}-"
report-name: "${{ matrix.go-module }} tests on ${{ matrix.os }}"
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ concurrency:

# Set environment variables available in all jobs and steps
env:
go_version: "1.25.5"
python_version: "3.9"
go_version: "1.27.3"
python_version: "3.11"

jobs:
# Check that a news file has been added to this branch when a PR is created
Expand All @@ -25,19 +25,19 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout with full history for to allow compare with base branch
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
- uses: actions/setup-python@v6
- uses: actions/setup-python@v7
with:
python-version: ${{ env.python_version }}
- uses: FranzDiebold/github-env-vars-action@v2
- name: Install CI/CD tools
run: pip install continuous-delivery-scripts && pip list
run: python -m pip install --upgrade 'continuous-delivery-scripts>=4.8.0' && pip list
- name: Assert news
run: bash ./scripts/setup_github.sh && cd-assert-news -b $GIT_BRANCH
run: cd-assert-news -b "${CI_ACTION_REF_NAME}"
env:
GIT_TOKEN: ${{ secrets.GIT_SECRET }}
GIT_BRANCH: ${{ github.head_ref || github.ref }}
- name: Report failure if needed
if: ${{ failure() }}
run: |
Expand All @@ -47,10 +47,10 @@ jobs:
name: Check for secrets
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v6
- uses: actions/setup-python@v7
- name: Install tools
run: pip install detect-secrets==1.0.3 && pip list
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
# FIXME: GitLeaks requires a licence now
Expand Down
38 changes: 18 additions & 20 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
schedule:
- cron: '19 21 * * 5'

env:
go_version: "1.27.3"

jobs:
analyze:
name: Analyze (${{ matrix.language }})
Expand All @@ -46,7 +49,6 @@ jobs:
matrix:
include:
- language: go
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
Expand All @@ -57,38 +59,34 @@ jobs:
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v6.0.2
uses: actions/checkout@v7.0.1

- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: ${{ env.go_version }}
cache: true
cache-dependency-path: '**/go.sum'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4.31.10
uses: github/codeql-action/init@v4.39.3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Build modules for analysis
uses: ARM-software/golang-utils/actions/go-multimodules@v1.172.0
with:
task: analyze
build-tags: ""

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4.31.10
uses: github/codeql-action/analyze@v4.39.3
with:
category: "/language:${{matrix.language}}"
12 changes: 6 additions & 6 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:

# Set environment variables available in all jobs and steps
env:
python_version: "3.10"
python_version: "3.11"
jobs:
update-go:
uses: ./.github/workflows/update-utils.yml
Expand All @@ -21,18 +21,18 @@ jobs:
needs: update-utils
steps:
# Checkout with full history for to allow compare with base branch
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
- uses: actions/setup-python@v6
- uses: actions/setup-python@v7
with:
python-version: ${{ env.python_version }}
- uses: FranzDiebold/github-env-vars-action@v2
- name: Install CI/CD tools
run: pip install continuous-delivery-scripts && pip list
run: python -m pip install --upgrade 'continuous-delivery-scripts>=4.8.0' && pip list
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2.5.0
uses: dependabot/fetch-metadata@v3.1.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Add a label
Expand All @@ -46,7 +46,7 @@ jobs:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Assert news
run: bash ./scripts/setup_github.sh && cd-assert-news -b ${CI_ACTION_REF_NAME}
run: cd-assert-news -b "${CI_ACTION_REF_NAME}"
env:
GIT_TOKEN: ${{ secrets.GIT_SECRET }}
- name: Auto-merge the PR
Expand Down
34 changes: 25 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: GitHub Release

env:
go_version: "1.25.5"
python_version: "3.10"
go_version: "1.27.3"
python_version: "3.11"

on:
workflow_dispatch:
Expand All @@ -19,12 +19,14 @@ jobs:
outputs:
changes: ${{ steps.check.outputs.changes }}
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v7.0.1
- name: Check if changes directory contains files
id: check
run: |
CHANGES=$(git show main:changes/ 2>/dev/null | grep -e .feature -e .bugfix -e .major -e .doc -e .misc)
echo "::set-output name=changes::$CHANGES"
echo "changes<<EOF" >> "$GITHUB_OUTPUT"
echo "$CHANGES" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
continue-on-error: true # in case '2>/dev/null' doesn't work

release:
Expand All @@ -33,23 +35,37 @@ jobs:
needs: [ check-for-changes ]
if: needs.check-for-changes.outputs.changes
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v7.0.1
with:
# Get the full history as this is required by goreleaser
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v6
uses: actions/setup-go@v7
with:
go-version: ${{ env.go_version }}
cache: true
cache-dependency-path: '**/go.sum'
- name: Setup python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ env.python_version }}
- uses: FranzDiebold/github-env-vars-action@v2
- name: Install CI/CD tools
run: pip install continuous-delivery-scripts>=2.7 && pip list
run: python -m pip install --upgrade 'continuous-delivery-scripts>=4.8.0' && pip list
- name: Install goreleaser
uses: goreleaser/goreleaser-action@v7
with:
install-only: true
distribution: goreleaser
version: latest
- name: Install Syft
uses: anchore/sbom-action/download-syft@v0
- name: Download Go dependencies for every module
uses: ARM-software/golang-utils/actions/go-multimodules@v1.172.0
with:
task: download
- name: Tag and release
run: bash ./scripts/setup_github.sh && cd-tag-and-release -b ${CI_ACTION_REF_NAME} -t ${{ github.event.inputs.release_type }} -vv
run: cd-tag-and-release -b "${CI_ACTION_REF_NAME}" -t ${{ github.event.inputs.release_type }} -vv
env:
# Using a specific token because GITHUB_TOKEN is not available https://github.com/marketplace/actions/workflow-dispatch#token
GIT_TOKEN: ${{ secrets.GIT_SECRET }}
8 changes: 4 additions & 4 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:

steps:
- name: "Checkout code"
uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v5.0.1
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v5.0.1
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
with:
results_file: results.sarif
results_format: sarif
Expand All @@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: SARIF file
path: results.sarif
Expand All @@ -68,6 +68,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@a2d9de63c2916881d0621fdb7e65abe32141606d # v3.30.7
uses: github/codeql-action/upload-sarif@3ea37a44b6e4e6847c46edae209410d258d548d1 # v3.30.7
with:
sarif_file: results.sarif
9 changes: 5 additions & 4 deletions .github/workflows/update-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Update Library

# Set environment variables available in all jobs and steps
env:
python_version: "3.9"
python_version: "3.11"
go_module: "utils"

on:
Expand All @@ -19,13 +19,13 @@ jobs:
name: Update Go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
- uses: actions/checkout@v7.0.1
with:
# So that we have correct GIT_TOKEN to push back to branch as we need workflow permissions
token: ${{ secrets.GIT_SECRET }}
ref: ${{ inputs.branch || github.head_ref || github.ref }}
- name: Setup python
uses: actions/setup-python@v6
uses: actions/setup-python@v7
with:
python-version: ${{ env.python_version }}
- name: Install continuous-delivery-scripts
Expand All @@ -35,14 +35,15 @@ jobs:
run: |
cd-license-files
- name: Checkout Update Go action
uses: actions/checkout@v6.0.2
uses: actions/checkout@v7.0.1
with:
repository: Arm-Debug/update-go-action
ref: refs/tags/latest
token: ${{ secrets.GIT_SECRET }}
persist-credentials: false
path: ./.github/workflows/update-go-action
- name: Update Go
continue-on-error: true
uses: ./.github/workflows/update-go-action
with:
dockerfile: Dockerfile.utils
Expand Down
Loading
Loading