Optimize and structure Makefile #524
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Tests and Build | |
on: | |
push: {} | |
pull_request: {} | |
env: | |
CI: true | |
GO111MODULE: on | |
GOPROXY: https://proxy.golang.org | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Set GOPATH and PATH | |
run: | | |
echo "GOPATH=$(dirname $GITHUB_WORKSPACE)" >> $GITHUB_ENV | |
echo "$(dirname $GITHUB_WORKSPACE)/bin" >> $GITHUB_PATH | |
shell: bash | |
- name: Install pre-requisites | |
run: | | |
# Github now comes with kustomize already installed | |
sudo rm $(command -v kustomize) || true | |
make prereqs | |
- name: Install dependencies | |
run: make deps | |
- name: Lint | |
run: make lint | |
- name: Run gofmt | |
run: | | |
diff -u <(echo -n) <(gofmt -d -e .) | |
- name: Run go vet | |
run: make vet | |
- name: Build plugin | |
run: make build | |
- name: Install | |
run: make install | |
- name: Test | |
run: XDG_CONFIG_HOME=$HOME/.config make test |