Repository navigation
82 lines (75 loc) · 2.38 KB
/
Copy pathci.yml
File metadata and controls
82 lines (75 loc) · 2.38 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI
# Every push to every branch, plus every pull request. Note that push
# events only fire in the repository that holds the branch: pushes to
# fork branches run this workflow in the fork.
on:
push:
branches:
- '**'
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: latest
- run: npm ci
- name: Build and summarize bundle size
run: npm run build -- --summary
test:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
# 26.9.0 is the oldest version package.json's engines field allows.
node-version: [latest, 26.9.0]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
prettier:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: latest
- run: npm ci
- run: npm run format:check
# The collector runs from a step, since a service container starts before
# the checkout and could not read its config. Its output directory is
# mounted at the same path, so one variable names the file for both.
collector:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: latest
- run: |
mkdir "$RUNNER_TEMP/collector"
echo "COLLECTOR_OUTPUT=$RUNNER_TEMP/collector/spans.jsonl" >> "$GITHUB_ENV"
- run: >-
docker run -d --name collector --user "$(id -u):$(id -g)"
-p 127.0.0.1:4318:4318 -e COLLECTOR_OUTPUT
-v "$PWD/test/collector/config.yaml:/etc/otelcol/config.yaml:ro"
-v "$RUNNER_TEMP/collector:$RUNNER_TEMP/collector"
otel/opentelemetry-collector:0.164.0@sha256:28b6d41ac51bff6b41ba5e8fe503569ffb9d6a1ea90f7a78419e86f34e44f750
--config /etc/otelcol/config.yaml
- run: node --test --test-force-exit test/collector/
- if: failure()
run: docker logs collector || true