CI fixes #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Ubuntu build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-module: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y cmake libc-ares-dev libre2-dev | |
- name: Checkout nginx | |
uses: actions/checkout@v4 | |
with: | |
repository: nginx/nginx | |
path: nginx | |
- name: Configure nginx | |
working-directory: nginx | |
run: auto/configure --with-compat | |
- name: Create build directory | |
run: mkdir build | |
- name: Build module | |
working-directory: build | |
run: | | |
cmake -DNGX_OTEL_NGINX_BUILD_DIR=${PWD}/../nginx/objs \ | |
-DNGX_OTEL_DEV=ON .. | |
make -j 4 | |
strip ngx_otel_module.so | |
- name: Archive module | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nginx-otel-module | |
path: build/ngx_otel_module.so | |
- name: Archive protoc and opentelemetry-proto | |
uses: actions/upload-artifact@v4 | |
with: | |
name: protoc-opentelemetry-proto | |
path: | | |
build/_deps/grpc-build/third_party/protobuf/protoc | |
build/_deps/otelcpp-src/third_party/opentelemetry-proto | |
test-module: | |
needs: build-module | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download module | |
uses: actions/download-artifact@v4 | |
with: | |
name: nginx-otel-module | |
path: build | |
- name: Download protoc and opentelemetry-proto | |
uses: actions/download-artifact@v4 | |
with: | |
name: protoc-opentelemetry-proto | |
path: build/_deps | |
- name: List files | |
run: ls -laR . | |
- name: Fix protoc file permissions | |
run: chmod +x build/_deps/grpc-build/third_party/protobuf/protoc | |
- name: Install perl modules | |
run: sudo cpan IO::Socket::SSL Crypt::Misc | |
- name: Download otelcol | |
run: | | |
curl -LO https://github.com/\ | |
open-telemetry/opentelemetry-collector-releases/releases/download/\ | |
v0.76.1/otelcol_0.76.1_linux_amd64.tar.gz | |
tar -xzf otelcol_0.76.1_linux_amd64.tar.gz | |
- name: Checkout nginx | |
uses: actions/checkout@v4 | |
with: | |
repository: nginx/nginx | |
path: nginx | |
- name: Build nginx | |
working-directory: nginx | |
run: | | |
auto/configure --with-compat --with-debug --with-http_ssl_module \ | |
--with-http_v2_module --with-http_v3_module | |
make -j 4 | |
- name: Checkout lib from nginx-tests | |
uses: actions/checkout@v4 | |
with: | |
repository: nginx/nginx-tests | |
sparse-checkout: | | |
lib | |
path: nginx-tests | |
- name: Run tests | |
working-directory: tests | |
run: | | |
PERL5LIB=../nginx-tests/lib TEST_NGINX_UNSAFE=1 \ | |
TEST_NGINX_VERBOSE=1 TEST_NGINX_GLOBALS="load_module \ | |
${PWD}/../build/ngx_otel_module.so;" prove -v . |