Skip to content

Commit

Permalink
feat: add ci-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shifty11 committed Oct 9, 2023
1 parent 517b84e commit 69d8037
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
name: lint
on: push
env:
GO_VERSION: "1.20.8"

jobs:
buf:
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v3
# Checkout the repository
- name: Checkout the repository
uses: actions/checkout@v4
# Install `buf`
- uses: bufbuild/buf-setup-action@v1
- name: Install `buf`
uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ github.token }}
# Lint Protobuf files
- uses: bufbuild/buf-lint-action@v1
- name: Lint Protobuf files
uses: bufbuild/buf-lint-action@v1
with:
buf_token: ${{ secrets.BUF_TOKEN }}

golangci:
name: lint
runs-on: ubuntu-latest
steps:
# Run `git checkout`
- uses: actions/checkout@v3
# Install `go`
- uses: actions/setup-go@v4
# Checkout the repository
- name: Checkout the repository
uses: actions/checkout@v4
# Setup Golang
- name: 🐿 Setup Golang
uses: actions/setup-go@v4
with:
go-version: '1.20'
cache: false
# Lint Go files
- name: golangci-lint
go-version: ${{env.GO_VERSION}}
# Lint go files with golangci-lint
- name: Lint go files with golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: test
on: push
env:
GO_VERSION: "1.20.8"

jobs:
test:
if: needs.get_diff.outputs.git_diff
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Check out repository code
uses: actions/checkout@v4
# Setup Golang
- name: 🐿 Setup Golang
uses: actions/setup-go@v4
with:
go-version: ${{env.GO_VERSION}}
# Test & coverage report creation
- name: Test & coverage report creation
run: go test -cover -mod=readonly ./x/...

0 comments on commit 69d8037

Please sign in to comment.