Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add github actions #96

Merged
merged 1 commit into from
Jul 29, 2024
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
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
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
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
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
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"go.lintTool": "golangci-lint",
"go.lintFlags": ["--fast"],
"pgFormatter.typeCase": "uppercase",
"pgFormatter.tabs": true,
"[sql]": {
Expand Down
5 changes: 5 additions & 0 deletions dev/lint-shellcheck
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[@]}"
Loading