Skip to content

feat(ci): create ci workflow (#46) #2

feat(ci): create ci workflow (#46)

feat(ci): create ci workflow (#46) #2

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
paths:
- "**.go"
- go.mod
- go.sum
pull_request:
branches: [ main ]
paths:
- "**.go"
- go.mod
- go.sum
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build
run: go build -v ./cmd/gh-not
- name: Test
run: go test -v ./...
# Taken from https://github.com/cli/cli/blob/trunk/.github/workflows/lint.yml
- name: Lint
run: |

Check failure on line 40 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 40
STATUS=0
assert-nothing-changed() {
local diff
"$@" >/dev/null || return 1
if ! diff="$(git diff -U1 --color --exit-code)"; then
printf '\e[31mError: running `\e[1m%s\e[22m` results in modifications that you must check into version control:\e[0m\n%s\n\n' "$*" "$diff" >&2
git checkout -- .
STATUS=1
fi
}
assert-nothing-changed go fmt ./...
assert-nothing-changed go mod tidy
exit $STATUS