Skip to content

Commit

Permalink
chore(ci/tests): switch tests from circle ci to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
qwqcode committed Oct 3, 2024
1 parent a6eba36 commit 7542235
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 98 deletions.
70 changes: 0 additions & 70 deletions .circleci/conditional_config.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .circleci/config.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/test-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test App

on:
push:
branches: ["*", "!release/*", "!nightly"]
paths: ["cmd/**", "internal/**", "server/**", "test/**", "main.go", "go.mod", "go.sum"]
tags-ignore: ["v*"]
pull_request:
branches: ["*", "!release/*", "!nightly"]
paths: ["cmd/**", "internal/**", "server/**", "test/**", "main.go", "go.mod", "go.sum"]

env:
REPORT_DIR: "/tmp/test-reports"

jobs:
test_app:
name: Test App on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- name: Print the Go version
run: go version

- name: Install tools
run: go install gotest.tools/gotestsum@latest

- name: Download Go modules
run: go mod download

- name: Run tests
run: |
mkdir -p $REPORT_DIR
gotestsum \
--junitfile $REPORT_DIR/unit-tests.xml \
--jsonfile $REPORT_DIR/unit-tests.json \
-- -coverprofile=$REPORT_DIR/coverage.out ./...
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: Go-Test-Results
path: ${{ env.REPORT_DIR }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
flags: go
file: ${{ env.REPORT_DIR }}/coverage.out
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 7542235

Please sign in to comment.