Skip to content

feat: bootstrap the meshStack CLI and move the API client in #6

feat: bootstrap the meshStack CLI and move the API client in

feat: bootstrap the meshStack CLI and move the API client in #6

Workflow file for this run

# meshStack CLI build, lint and test workflow.
name: Tests
on:
pull_request:
paths-ignore:
- 'README.md'
push:
branches:
- main
paths-ignore:
- 'README.md'
# Testing only needs permissions to read the repository contents.
permissions:
contents: read
# Cancel superseded runs on the same ref.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Go Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
cache: true
- run: go mod tidy
- run: go build -v ./...
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after 'go mod tidy'. Run 'go mod tidy' command and commit."; exit 1)
golangci:
needs: [ build ]
name: Go Lint and Format Check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
# The repository's pinned Go, not 'stable'. gofmt is part of this job, and its
# formatting changes between Go releases, so linting with a newer toolchain than
# the one the code is written against reports differences that no contributor can
# reproduce.
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0
with:
version: latest
# Deliberately no only-new-issues: this repository starts clean and CI keeps
# it that way, so filtering to changed code would only hide findings. It also
# misreports: filtering a patch that adds a whole directory at once produced a
# gci finding on a file that a full run, on two linter versions, calls clean.
- name: Suggest fix command on failure
if: failure()
run: |
echo "::error::Linting or formatting issues detected. Run 'task lint -- --fix' locally to automatically fix these issues, then commit the changes."
test:
needs: [ build ]
name: Go Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: 'go.mod'
cache: true
- run: go test -v ./...