-
Notifications
You must be signed in to change notification settings - Fork 9
62 lines (56 loc) · 1.94 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: CI
on:
push:
branches:
- "main"
- "release-branch/*"
merge_group:
branches:
- "main"
concurrency:
# For PRs, later CI runs preempt previous ones. e.g. a force push on a PR
# cancels running CI jobs and starts all new ones.
#
# For non-PR pushes, concurrency.group needs to be unique for every distinct
# CI run we want to have happen. Use run_id, which in practice means all
# non-PR CI runs will be allowed to run without preempting each other.
group: ${{ github.workflow }}-$${{ github.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
build:
runs-on: self-hosted
strategy:
matrix:
go-version: ["1.23.1"]
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: go mod download
- name: Unit and Integration test
env:
CL_INFOCLACE_SSH: ${{ secrets.CL_INFOCLACE_SSH }}
CL_GITHUB_SECRET: ${{ secrets.CL_GITHUB_SECRET }}
run: |
export CL_HOME=`pwd`
rm -rf internal/server/appspecs && cd internal/server
git clone --single-branch --depth 1 https://github.com/claceio/appspecs.git
rm -rf appspecs/.git
cd $CL_HOME
go install github.com/commander-cli/commander/v2/cmd/commander@latest
export CL_CONTAINER_COMMANDS=docker # using self-hosted runner, use Docker for container tests
gmake covtest
docker stop -t 1 $(docker ps -a -q)
docker system prune -f
- name: Upload Go test results
uses: actions/upload-artifact@v3
with:
name: Go-results-${{ matrix.go-version }}
path: TestResults-${{ matrix.go-version }}.json
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}