-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add make target and actions job to execute tests (#85)
* [CI] Add make target to execute tests, actions job to execute tests, and modified readme * Build UI before trying to run tests
- Loading branch information
Showing
3 changed files
with
63 additions
and
3 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: Run integration tests | ||
|
||
on: | ||
# Runs when a push is made the main branch | ||
push: | ||
branches: [ "main" ] | ||
# Runs when a PR is targeting the main branch | ||
pull_request: | ||
branches: [ "main" ] | ||
# Manual activation | ||
workflow_dispatch: | ||
|
||
jobs: | ||
go_test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [ 18 ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.x | ||
|
||
- name: Setup Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
cache-dependency-path: ui/pnpm-lock.yaml | ||
|
||
- name: Build UI Dashboard | ||
run: pnpm --dir=./ui install && pnpm --dir=./ui build | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ">=1.21.3" | ||
|
||
- name: Tidy modules | ||
run: go mod tidy | ||
|
||
- name: Run tests | ||
run: go test -v -coverprofile coverage.csv ./... | ||
|
||
- name: Create coverage report | ||
run: go tool cover -html=coverage.csv -o coverage.html | ||
|
||
- name: Upload coverage report | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: coverage.html | ||
path: coverage.html |
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 |
---|---|---|
|
@@ -24,4 +24,7 @@ clean: | |
rm -rf ui/build/* | ||
|
||
vet: | ||
go vet | ||
go vet | ||
|
||
test: | ||
go test ./... |
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