-
Notifications
You must be signed in to change notification settings - Fork 309
80 lines (66 loc) · 2.22 KB
/
test-k8s-lib-injection.yaml
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
name: "Lib Injection Test"
on:
pull_request:
push:
branches: [master]
schedule:
- cron: '0 4 * * *'
jobs:
build-and-publish-init-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # 2.3.4
- name: Log in to the Container registry
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Docker Image Tag
id: set_names
run: |
echo "Docker image tag: $(echo ${GITHUB_HEAD_REF-${GITHUB_REF#refs/heads/}} | tr / -)"
echo "image_name=$(echo ${GITHUB_HEAD_REF-${GITHUB_REF#refs/heads/}} | tr / -)" >> $GITHUB_OUTPUT
- name: Npm pack for injection image
run: |
npm pack
- uses: ./.github/actions/injection
with:
init-image-version: ${GITHUB_SHA}
- name: Push snapshot image
run: |
docker buildx build --platform=linux/amd64,linux/arm/v7,linux/arm64/v8 -t ghcr.io/datadog/dd-trace-js/dd-lib-js-init:latest_snapshot --push lib-injection
if: ${{ steps.set_names.outputs.image_name }} == 'master'
lib-injection-tests:
needs:
- build-and-publish-init-image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
TEST_LIBRARY: nodejs
WEBLOG_VARIANT: sample-app
DOCKER_REGISTRY_IMAGES_PATH: ghcr.io/datadog
DOCKER_IMAGE_TAG: ${{ github.sha }}
BUILDX_PLATFORMS: linux/amd64
steps:
- name: Checkout system tests
uses: actions/checkout@v4
with:
repository: 'DataDog/system-tests'
- name: Install runner
uses: ./.github/actions/install_runner
- name: Run K8s Lib Injection Tests
run: ./run.sh K8S_LIB_INJECTION_BASIC
- name: Compress logs
id: compress_logs
if: always()
run: tar -czvf artifact.tar.gz $(ls | grep logs)
- name: Upload artifact
if: always()
uses: actions/upload-artifact@v2
with:
name: logs_k8s_lib_injection
path: artifact.tar.gz