Skip to content

Code Analysis & Tests #1

Code Analysis & Tests

Code Analysis & Tests #1

Workflow file for this run

name: Code Analysis & Tests
on:
workflow_dispatch:
pull_request:
branches:
- develop
- main
env:
MIN_GO_VERSION: 1.19.x
jobs:
lint:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
go-version: ["${{ env.MIN_GO_VERSION }}", "1.x"]

Check failure on line 17 in .github/workflows/code-analysis.yml

View workflow run for this annotation

GitHub Actions / Code Analysis & Tests

Invalid workflow file

The workflow is not valid. .github/workflows/code-analysis.yml (Line: 17, Col: 22): Unrecognized named-value: 'env'. Located at position 1 within expression: env.MIN_GO_VERSION .github/workflows/code-analysis.yml (Line: 43, Col: 22): Unrecognized named-value: 'env'. Located at position 1 within expression: env.MIN_GO_VERSION
name: Lint (${{ matrix.os }}/${{ matrix.go-version }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache: true # caching and restoring go modules and build outputs.
- run: echo "GOVERSION=$(go version)" >> $GITHUB_ENV
- name: Lint
uses: reviewdog/action-golangci-lint@v2
with: # https://github.com/reviewdog/action-golangci-lint#inputs
go_version_file: "go.mod"
workdir: ./
golangci_lint_flags: "--config=./.golangci.yaml --verbose --new-from-rev=${{ github.event.pull_request.base.sha }}"
fail_on_error: true
test:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
go-version: ["${{ env.MIN_GO_VERSION }}", "1.x"]
name: Test (${{ matrix.os }}/${{ matrix.go-version }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
cache: true # caching and restoring go modules and build outputs.
- run: echo "GOVERSION=$(go version)" >> $GITHUB_ENV
- name: Test
run: go test ./...