client_golang/.github/workflows/go.yml

67 lines
1.8 KiB
YAML
Raw Normal View History

---
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
uses: actions/checkout@v4
- 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
Bump the github-actions group with 3 updates Bumps the github-actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action) and [actions/setup-go](https://github.com/actions/setup-go). Updates `actions/checkout` from 2.7.0 to 4.1.1 - [Release notes](https://github.com/actions/checkout/releases) - [Commits](https://github.com/actions/checkout/compare/v2.7.0...v4.1.1) Updates `github/codeql-action` from 1.1.39 to 3.23.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/231aa2c8a89117b126725a0e11897209b7118144...e5f05b81d5b6ff8cfa111c80c22c5fd02a384118) Updates `actions/setup-go` from 3.5.0 to 5.0.0 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v3.5.0...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 19:45:44 +03:00
uses: actions/checkout@v4.1.1
- name: Set up Go ${{ matrix.go_version }}
build(deps): bump the github-actions group across 1 directory with 3 updates Bumps the github-actions group with 3 updates in the / directory: [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata), [github/codeql-action](https://github.com/github/codeql-action) and [actions/setup-go](https://github.com/actions/setup-go). Updates `dependabot/fetch-metadata` from 2.1.0 to 2.2.0 - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/5e5f99653a5b510e8555840e80cbf1514ad4af38...dbb049abf0d677abbd7f7eee0375145b417fdd34) Updates `github/codeql-action` from 3.25.3 to 3.25.13 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/d39d31e687223d841ef683f52467bd88e9b21c14...2d790406f505036ef40ecba973cc774a50395aac) Updates `actions/setup-go` from 5.0.0 to 5.0.2 - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v5...v5.0.2) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
2024-07-19 19:13:47 +03:00
uses: actions/setup-go@v5.0.2
with:
go-version: ${{ matrix.go_version }}
- name: Cache Go modules
id: cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: v1-go${{ matrix.go_version }}
- name: Run tests and check license
run: make check_license test
env:
CI: true
- name: Run style and unused
if: ${{ matrix.go_version == '1.20' }}
run: make style unused