Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 32 additions & 18 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,49 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: cachix/install-nix-action@v20
- uses: cachix/cachix-action@v12
with:
go-version: "1.20"
name: devenv
- name: Install devenv.sh
run: nix profile install github:cachix/devenv/latest
shell: sh
- run: devenv ci
- run: devenv shell task lint

- name: Run golangci-lint
uses: golangci/[email protected]
check:
name: Check file format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v20
- uses: cachix/cachix-action@v12
with:
name: devenv
- name: Install devenv.sh
run: nix profile install github:cachix/devenv/latest
shell: sh
- run: devenv ci
- run: devenv shell task fmt:check
- run: devenv shell task go-imports

tests:
name: Run tests
strategy:
matrix:
go-version: [1.16.x]
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: "${{ matrix.os }}"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
- uses: cachix/install-nix-action@v20
- uses: cachix/cachix-action@v12
with:
go-version: "1.20"
- name: Install Taskfile
uses: arduino/setup-task@v1
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: run tests
run: "task tests:coverage"

name: devenv
- name: Install devenv.sh
run: nix profile install github:cachix/devenv/latest
shell: sh
- run: devenv ci
- run: devenv shell task tests:coverage
- uses: codecov/codecov-action@v2
with:
verbose: true

11 changes: 11 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ tasks:
cmds:
- task: deps
- task: go-imports
- task: fmt:check
- task: lint
- task: tests

Expand All @@ -69,6 +70,16 @@ tasks:
cmds:
- goimports -w -local {{.PACKAGE}} *.go cmd internal plugins test

fmt:
desc: Format go code
cmds:
- go fmt ./...

fmt:check:
desc: Check that all go files are properly formatted
cmds:
- test -z $(gofmt -l .)

lint:
desc: Lint go code
cmds:
Expand Down