-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## tl;dr - Adds Github actions - Adds shellcheck script - Updates vscode config to use the correct lint tool
- Loading branch information
Showing
4 changed files
with
65 additions
and
0 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,25 @@ | ||
name: Lint | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
permissions: | ||
contents: read | ||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: shellcheck | ||
run: | | ||
sudo apt-get -y install tree | ||
dev/lint-shellcheck | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
args: --timeout=5m --config dev/.golangci.yaml |
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,33 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version-file: go.mod | ||
- run: dev/docker/up | ||
- name: Run Tests | ||
run: | | ||
export GOPATH="${HOME}/go/" | ||
export PATH="${PATH}:${GOPATH}/bin" | ||
go install github.com/jstemmer/go-junit-report/v2@latest | ||
go test -v ./... | go-junit-report -set-exit-code -iocopy -out report.xml | ||
- name: Run Race Tests | ||
run: | | ||
export GOPATH="${HOME}/go/" | ||
export PATH="${PATH}:${GOPATH}/bin" | ||
go test -v ./... -race | ||
- uses: datadog/junit-upload-github-action@v1 | ||
with: | ||
api-key: ${{ secrets.DD_API_KEY }} | ||
service: xmtp-node-go | ||
files: report.xml | ||
env: ci |
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
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,5 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
read -ra shellcheck_paths <<< "$(grep -rIzl '^#!' dev)" | ||
shellcheck -x "${shellcheck_paths[@]}" |