-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (67 loc) · 1.86 KB
/
ci.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
63
64
65
66
67
68
69
name: CI
on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "LICENSE"
pull_request:
paths-ignore:
- "**/*.md"
- "LICENSE"
schedule:
- cron: '37 21 * * 5'
jobs:
test-and-build:
strategy:
matrix:
go-version: ["1.22"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- if: matrix.os == 'ubuntu-latest'
name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.1
skip-pkg-cache: true
only-new-issues: true
- name: Run unit tests
run: make test
- name: Build collector
run: make build
- if: matrix.os != 'windows-latest'
name: Launch collector for E2E tests
run: ./collector --config ./_tests/e2e/test-config.yml &
- if: matrix.os != 'windows-latest'
name: Run E2E tests
run: ./_tests/e2e/test.sh ./exported-trace.json
build-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push image
uses: docker/build-push-action@v5
with:
# this workflow runs on PRs, it only tests if the image can be built
push: false
context: .
file: ./Dockerfile
tags: hypertrace/hypertrace-collector:latest
build-args: |
VERSION=latest
GIT_COMMIT=${GITHUB_SHA}
- name: Run Trivy vulnerability scanner
uses: hypertrace/github-actions/trivy-image-scan@main
with:
image: hypertrace/hypertrace-collector
tag: latest
output-mode: github