Skip to content

Commit 5e0987c

Browse files
authored
Merge branch 'main' into fix-testcontainers-lint-issues-01
2 parents 2f39e96 + 725fa07 commit 5e0987c

File tree

114 files changed

+3317
-2218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+3317
-2218
lines changed

.github/actionlint.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Configuration related to self-hosted runner.
2+
self-hosted-runner:
3+
# Labels of self-hosted runner in array of strings.
4+
labels:
5+
- otel-arm64
6+
- otel-windows
7+
8+
# Path-specific configurations.
9+
paths:
10+
# Configs are meant to be workflow helpers, not valid GitHub actions. Ignore all errors
11+
# from these files.
12+
.github/workflows/configs/**:
13+
ignore:
14+
- '.*'
15+
16+
# Ignore these notifications/errors for all workflows
17+
.github/workflows/*.{yml,yaml}:
18+
ignore:
19+
- 'index access of array must be type of number but.*' # Caused by taking advantage of GitHub's automatic conversion of bools to integers in for array indexing
20+
21+
# All Windows Paths should ignore errors related to PowerShell formatting.
22+
# Linter shellcheck is not supported for PowerShell
23+
.github/workflows/**/*win*.{yml,yaml}:
24+
ignore:
25+
- 'shellcheck reported issue in this script: SC1001:.+'
26+
- 'shellcheck reported issue in this script: SC1009:.+'
27+
- 'shellcheck reported issue in this script: SC1012:.+'
28+
- 'shellcheck reported issue in this script: SC1050:.+'
29+
- 'shellcheck reported issue in this script: SC1070:.+'
30+
- 'shellcheck reported issue in this script: SC1072:.+'
31+
- 'shellcheck reported issue in this script: SC1073:.+'
32+
- 'shellcheck reported issue in this script: SC1087:.+'
33+
- 'shellcheck reported issue in this script: SC1133:.+'
34+
- 'shellcheck reported issue in this script: SC2006:.+'
35+
- 'shellcheck reported issue in this script: SC2046:.+'
36+
- 'shellcheck reported issue in this script: SC2086:.+'
37+
- 'shellcheck reported issue in this script: SC2283:.+'
38+
39+
# PowerShell lint messages need to be ignored
40+
.github/workflows/**/*msi*.{yml,yaml}:
41+
ignore:
42+
- 'shellcheck reported issue in this script: SC1001:.+'
43+
- 'shellcheck reported issue in this script: SC1009:.+'
44+
- 'shellcheck reported issue in this script: SC1012:.+'
45+
- 'shellcheck reported issue in this script: SC1050:.+'
46+
- 'shellcheck reported issue in this script: SC1070:.+'
47+
- 'shellcheck reported issue in this script: SC1072:.+'
48+
- 'shellcheck reported issue in this script: SC1073:.+'
49+
- 'shellcheck reported issue in this script: SC1087:.+'
50+
- 'shellcheck reported issue in this script: SC1133:.+'
51+
- 'shellcheck reported issue in this script: SC2006:.+'
52+
- 'shellcheck reported issue in this script: SC2046:.+'
53+
- 'shellcheck reported issue in this script: SC2086:.+'
54+
- 'shellcheck reported issue in this script: SC2283:.+'
55+
56+
# PowerShell lint messages need to be ignored
57+
.github/workflows/chef-test.yml:
58+
ignore:
59+
- 'shellcheck reported issue in this script: SC1081:.+'
60+
- 'shellcheck reported issue in this script: SC2086:.+'
61+
62+
# PowerShell lint messages need to be ignored
63+
64+
.github/workflows/puppet-test.yml:
65+
ignore:
66+
- 'shellcheck reported issue in this script: SC1050:.+'
67+
- 'shellcheck reported issue in this script: SC1072:.+'
68+
- 'shellcheck reported issue in this script: SC1073:.+'
69+
70+
# PowerShell lint messages need to be ignored
71+
.github/workflows/vuln-scans.yml:
72+
ignore:
73+
- 'shellcheck reported issue in this script: SC1050:.+'
74+
- 'shellcheck reported issue in this script: SC1072:.+'
75+
- 'shellcheck reported issue in this script: SC1073:.+'
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: 'setup environment'
2+
description: 'setup go environment'
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Set up Go
8+
uses: actions/setup-go@v5
9+
with:
10+
go-version: ${{ env.GO_VERSION }}
11+
cache-dependency-path: '**/go.sum'
12+
13+
- name: Installing required tools
14+
run: |
15+
cd ${{github.workspace}} && make install-tools
16+
shell: bash
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: agent-bundle-linux
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
ARCH:
7+
required: true
8+
type: string
9+
env:
10+
GO_VERSION: 1.23.10
11+
12+
jobs:
13+
agent-bundle-linux:
14+
runs-on: ${{ fromJSON('["ubuntu-24.04", "otel-arm64"]')[inputs.ARCH == 'arm64'] }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/cache@v4
19+
id: bundle-cache
20+
with:
21+
path: .cache/buildx/agent-bundle-${{ inputs.ARCH }}
22+
key: agent-bundle-buildx-${{ inputs.ARCH }}-${{ hashFiles('packaging/bundle/**') }}
23+
restore-keys: |
24+
agent-bundle-buildx-${{ inputs.ARCH }}-
25+
26+
- run: make -C packaging/bundle agent-bundle-linux ARCH=${{ inputs.ARCH }}
27+
env:
28+
BUNDLE_CACHE_HIT: "${{ steps.bundle-cache.outputs.cache-hit }}"
29+
30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: agent-bundle-linux-${{ inputs.ARCH }}
33+
path: ./dist/agent-bundle_linux_${{ inputs.ARCH }}.tar.gz
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: agent-bundle-windows
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
OS:
7+
required: true
8+
type: string
9+
PIP_CACHE_DIR:
10+
required: true
11+
type: string
12+
13+
env:
14+
GO_VERSION: 1.23.10
15+
16+
jobs:
17+
agent-bundle-windows:
18+
runs-on: ${{ inputs.OS }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/cache@v4
23+
with:
24+
path: ${{ inputs.PIP_CACHE_DIR }}
25+
key: agent-bundle-windows-pip-${{ hashFiles('packaging/bundle/collectd-plugins.yaml', 'packaging/bundle/scripts/requirements.txt') }}
26+
27+
- run: ./packaging/bundle/scripts/windows/make.ps1 bundle
28+
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: agent-bundle-windows-${{ inputs.OS }}
32+
path: ./dist/agent-bundle_windows_amd64.zip

.github/workflows/ansible.yml

Lines changed: 51 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -32,114 +32,62 @@ env:
3232
GO_VERSION: 1.23.10
3333

3434
jobs:
35-
setup-environment:
36-
runs-on: ubuntu-24.04
37-
steps:
38-
- name: Check out the codebase.
39-
uses: actions/checkout@v4
40-
41-
- name: Set up Go
42-
uses: actions/setup-go@v5
43-
with:
44-
go-version: ${{ env.GO_VERSION }}
45-
cache-dependency-path: '**/go.sum'
46-
47-
- name: Installing dependency
48-
run: |
49-
make install-tools
50-
5135
cross-compile:
52-
runs-on: ubuntu-24.04
53-
needs: [ setup-environment ]
5436
strategy:
5537
matrix:
56-
SYS_BINARIES: [ "binaries-linux_amd64", "binaries-linux_arm64", "binaries-linux_ppc64le" ]
57-
steps:
58-
- name: Check out the codebase.
59-
uses: actions/checkout@v4
60-
61-
- name: Set up Go
62-
uses: actions/setup-go@v5
63-
with:
64-
go-version: ${{ env.GO_VERSION }}
65-
cache-dependency-path: '**/go.sum'
66-
67-
- name: Build Collector
68-
run: |
69-
make ${{ matrix.SYS_BINARIES }}
70-
71-
- name: Uploading binaries
72-
uses: actions/upload-artifact@v4
73-
with:
74-
name: ${{ matrix.SYS_BINARIES }}
75-
path: |
76-
./bin/*
38+
SYS_BINARIES: [ "binaries-linux_amd64", "binaries-linux_arm64", "binaries-linux_ppc64le", "binaries-windows_amd64"]
39+
uses: ./.github/workflows/compile.yml
40+
with:
41+
SYS_BINARY: ${{ matrix.SYS_BINARIES }}
7742

7843
agent-bundle-linux:
79-
runs-on: ${{ fromJSON('["ubuntu-24.04", "otel-arm64"]')[matrix.ARCH == 'arm64'] }}
8044
strategy:
8145
matrix:
8246
ARCH: [ "amd64", "arm64" ]
8347
fail-fast: false
84-
steps:
85-
- uses: actions/checkout@v4
86-
87-
- uses: actions/cache@v4
88-
id: bundle-cache
89-
with:
90-
path: .cache/buildx/agent-bundle-${{ matrix.ARCH }}
91-
key: agent-bundle-buildx-${{ matrix.ARCH }}-${{ hashFiles('packaging/bundle/**') }}
92-
restore-keys: |
93-
agent-bundle-buildx-${{ matrix.ARCH }}-
94-
95-
- run: make -C packaging/bundle agent-bundle-linux ARCH=${{ matrix.ARCH }}
96-
env:
97-
BUNDLE_CACHE_HIT: "${{ steps.bundle-cache.outputs.cache-hit }}"
98-
99-
- uses: actions/upload-artifact@v4
100-
with:
101-
name: agent-bundle-linux-${{ matrix.ARCH }}
102-
path: ./dist/agent-bundle_linux_${{ matrix.ARCH }}.tar.gz
48+
uses: ./.github/workflows/agent-bundle-linux.yml
49+
with:
50+
ARCH: ${{ matrix.ARCH }}
10351

10452
build-package:
105-
runs-on: ubuntu-24.04
10653
needs: [ cross-compile, agent-bundle-linux ]
10754
strategy:
10855
matrix:
10956
SYS_PACKAGE: [ "deb", "rpm", "tar" ]
11057
ARCH: [ "amd64", "arm64" ]
11158
fail-fast: false
112-
steps:
113-
- name: Check out the codebase.
114-
uses: actions/checkout@v4
115-
with:
116-
fetch-depth: 0
117-
118-
- name: Set up Go
119-
uses: actions/setup-go@v5
120-
with:
121-
go-version: ${{ env.GO_VERSION }}
122-
cache-dependency-path: '**/go.sum'
59+
uses: ./.github/workflows/build-package.yml
60+
with:
61+
SYS_PACKAGE: ${{ matrix.SYS_PACKAGE }}
62+
ARCH: ${{ matrix.ARCH }}
12363

124-
- name: Downloading binaries-linux_${{ matrix.ARCH }}
125-
uses: actions/download-artifact@v4
126-
with:
127-
name: binaries-linux_${{ matrix.ARCH }}
128-
path: ./bin
129-
130-
- uses: actions/download-artifact@v4
131-
with:
132-
name: agent-bundle-linux-${{ matrix.ARCH }}
133-
path: ./dist
64+
agent-bundle-windows:
65+
needs: lint
66+
strategy:
67+
matrix:
68+
OS: [ "windows-2025" ]
69+
uses: ./.github/workflows/agent-bundle-windows.yml
70+
with:
71+
OS: ${{ matrix.OS }}
72+
PIP_CACHE_DIR: ${{ github.workspace }}/.cache/pip
13473

135-
- name: Build ${{ matrix.SYS_PACKAGE }} ${{ matrix.ARCH }} package
136-
run: make ${{ matrix.SYS_PACKAGE }}-package SKIP_COMPILE=true SKIP_BUNDLE=true VERSION="" ARCH="${{ matrix.ARCH }}"
74+
msi-custom-actions:
75+
needs: lint
76+
strategy:
77+
matrix:
78+
OS: [ "windows-2025" ]
79+
uses: ./.github/workflows/msi-custom-actions.yml
80+
with:
81+
OS: ${{ matrix.OS }}
13782

138-
- name: Uploading ${{ matrix.SYS_PACKAGE }} ${{ matrix.ARCH }} package artifacts
139-
uses: actions/upload-artifact@v4
140-
with:
141-
name: ${{ matrix.SYS_PACKAGE }}-${{ matrix.ARCH }}-package
142-
path: ./dist/splunk-otel-collector*
83+
msi-build:
84+
needs: [cross-compile, agent-bundle-windows, msi-custom-actions]
85+
strategy:
86+
matrix:
87+
OS: [ "windows-2025" ]
88+
uses: ./.github/workflows/msi-build.yml
89+
with:
90+
OS: ${{ matrix.OS }}
14391

14492
lint:
14593
name: Lint
@@ -202,7 +150,7 @@ jobs:
202150
molecule-plugins[docker]==23.5.0
203151
docker==7.0.0
204152
requests<2.32.0
205-
urllib3<2
153+
urllib3<3
206154
207155
- name: Set up Python 3.
208156
uses: actions/setup-python@v5
@@ -217,7 +165,7 @@ jobs:
217165
# workaround for https://github.com/yaml/pyyaml/issues/724
218166
pip3 install 'wheel==0.40.0'
219167
pip3 install 'Cython<3.0' 'PyYaml~=5.0' --no-build-isolation
220-
pip3 install --use-pep517 -r ${GITHUB_WORKSPACE}/requirements.txt
168+
pip3 install --use-pep517 -r "${GITHUB_WORKSPACE}/requirements.txt"
221169
222170
- name: Run Molecule tests.
223171
run: molecule --debug -v --base-config ./molecule/config/docker.yml test --all
@@ -228,7 +176,7 @@ jobs:
228176

229177
windows-test:
230178
name: Windows Test
231-
needs: lint
179+
needs: [lint, msi-build]
232180
runs-on: ubuntu-24.04
233181
defaults:
234182
run:
@@ -250,13 +198,22 @@ jobs:
250198
- default_install_remote_version
251199
- custom_vars
252200
- with_instrumentation
201+
- custom_vars_install_old_version
253202
steps:
254203
- name: Free up disk space for vagrant box
255204
uses: jlumbroso/[email protected]
256205

257206
- name: Check out the codebase.
258207
uses: actions/checkout@v4
259208

209+
- name: Make tmp directory for msi build artifact
210+
run: mkdir -p /tmp/msi-build
211+
212+
- uses: actions/download-artifact@v4
213+
with:
214+
name: msi-build-windows-2025
215+
path: /tmp/msi-build
216+
260217
- name: Install vagrant and virtualbox
261218
run: |
262219
sudo apt update && sudo apt install -y virtualbox
@@ -283,16 +240,16 @@ jobs:
283240
cache-dependency-path: "${{ github.workspace }}/requirements.txt"
284241

285242
- name: Install test dependencies.
286-
run: pip3 install --use-pep517 -r ${GITHUB_WORKSPACE}/requirements.txt
243+
run: pip3 install --use-pep517 -r "${GITHUB_WORKSPACE}/requirements.txt"
287244

288245
- name: Download vagrant box
289246
run: |
290247
box=$( yq ".platforms[] | select(.name == \"${{ matrix.distro }}\") | .box" ./molecule/config/windows.yml )
291248
box_version=$( yq ".platforms[] | select(.name == \"${{ matrix.distro }}\") | .box_version" ./molecule/config/windows.yml )
292249
eval "box_version=${box_version}"
293-
json=$( wget -nv -O- https://vagrantcloud.com/api/v2/vagrant/${box} )
250+
json=$( wget -nv -O- "https://vagrantcloud.com/api/v2/vagrant/${box}" )
294251
url=$( echo "$json" | jq -r ".versions[] | select(.version == \"${box_version}\") | .providers[] | select(.name == \"virtualbox\") | .url" )
295-
wget -nv -O /tmp/vagrant.box $url
252+
wget -nv -O /tmp/vagrant.box "$url"
296253
297254
- name: Clean VirtualBox cache
298255
run: |

0 commit comments

Comments
 (0)