2024-08-07 15:49:16 +03:00
|
|
|
---
|
|
|
|
name: Go
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- "release-*"
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
# Minimal permissions to be inherited by any job that don't declare it's own permissions
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
supportedVersions:
|
|
|
|
name: Fetch supported Go versions
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
supported_versions: ${{ steps.matrix.outputs.supported_versions }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-10-08 20:28:10 +03:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2024-08-07 15:49:16 +03:00
|
|
|
- name: Read supported_go_versions.txt
|
|
|
|
id: matrix
|
|
|
|
run: |
|
|
|
|
versions=$(cat supported_go_versions.txt)
|
|
|
|
matrix="[$(echo "$versions" | sed 's/\(.*\)/"\1"/' | paste -s -d,)]"
|
|
|
|
echo "supported_versions=$matrix" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: supportedVersions
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
go_version: ${{ fromJSON(needs.supportedVersions.outputs.supported_versions) }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-10-08 20:28:10 +03:00
|
|
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
2024-08-07 15:49:16 +03:00
|
|
|
|
|
|
|
- name: Run tests and check license
|
2024-10-08 20:28:10 +03:00
|
|
|
uses: dagger/dagger-for-github@fc945fa66fc7bfa72bc80f85b1a1ef4bd1d30cbb # v6.11.0
|
2024-08-07 15:49:16 +03:00
|
|
|
with:
|
|
|
|
version: "latest"
|
|
|
|
verb: call
|
|
|
|
args: -vvv --src . make --go-version ${{matrix.go_version}} --args 'check_license test'
|
|
|
|
|
|
|
|
- name: Run style and unused
|
2024-10-08 20:28:10 +03:00
|
|
|
uses: dagger/dagger-for-github@fc945fa66fc7bfa72bc80f85b1a1ef4bd1d30cbb # v6.11.0
|
2024-08-30 17:56:27 +03:00
|
|
|
if: ${{ matrix.go_version == '1.21' }}
|
2024-08-07 15:49:16 +03:00
|
|
|
with:
|
|
|
|
version: "latest"
|
|
|
|
verb: call
|
|
|
|
args: -vvv --src . make --args 'check_license test'
|