Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4077 from werf/commit-tests-workflow
ci: added commit-tests workflow to run unit tests and lint
- Loading branch information
Showing
3 changed files
with
57 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Commit tests | ||
|
||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/commit_tests.yml' | ||
- '**/*.go' | ||
|
||
jobs: | ||
unit-test: | ||
name: Unit testing | ||
runs-on: ubuntu-latest | ||
env: | ||
GOFLAGS: -mod=readonly | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Prepare environment | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu libbtrfs-dev | ||
git config --global user.email "you@example.com" | ||
git config --global user.name "Your Name" | ||
- name: Test | ||
run: | | ||
make unit-test | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
env: | ||
GOFLAGS: -mod=readonly | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Prepare environment | ||
run: | | ||
sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu libbtrfs-dev | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.43.0 | ||
- name: Lint | ||
run: | | ||
make lint | ||
This file was deleted.
Oops, something went wrong.
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