1515jobs :
1616  nginx-build-test :
1717    name : nginx 
18-     runs-on : ubuntu-20 .04 
18+     runs-on : ubuntu-24 .04 
1919    strategy :
20+       fail-fast : false 
2021      matrix :
21-         os : [ubuntu-20 .04, ubuntu-18.04,  debian-10.11, debian-11.3 ] 
22-         nginx-rel  : [mainline, stable ] 
22+         image : [" ubuntu:24 .04", " debian:11", "alpine:3.20", "amazonlinux:2", "amazonlinux:2023" ] 
23+         nginx : ["1.27.3", "1.27.1", "1.26.2", "1.24.0", "1.22.1" ] 
2324    steps :
2425      - name : checkout otel nginx 
25-         uses : actions/checkout@v3  
26+         uses : actions/checkout@v4  
2627      - name : setup 
2728        run : | 
2829          sudo ./instrumentation/nginx/ci/setup_environment.sh 
29-        - name : generate dockerfile 
30-         run : | 
31-           cd instrumentation/nginx/test/instrumentation 
32-           mix local.hex --force --if-missing 
33-           mix local.rebar --force --if-missing 
34-           mix deps.get 
35-           mix dockerfiles .. ${{ matrix.os }}:${{ matrix.nginx-rel }} 
3630       - name : setup buildx 
3731        id : buildx 
38-         uses : docker/setup-buildx-action@master  
32+         uses : docker/setup-buildx-action@v3  
3933        with :
4034          install : true 
41-       - name : cache docker layers 
42-         uses : actions/cache@v3 
43-         with :
44-           path : /tmp/buildx-cache/ 
45-           key : nginx-${{ matrix.os }}-${{ matrix.nginx-rel }}-${{ github.sha }} 
46-           restore-keys : | 
47-             nginx-${{ matrix.os }}-${{ matrix.nginx-rel }} 
4835      - name : build express backend docker 
4936        run : | 
5037          cd instrumentation/nginx 
51-           docker buildx  build -t otel-nginx-test/express-backend \ 
38+           docker build -t otel-nginx-test/express-backend \ 
5239            -f test/backend/simple_express/Dockerfile \ 
5340            --cache-from type=local,src=/tmp/buildx-cache/express \ 
5441            --cache-to type=local,dest=/tmp/buildx-cache/express-new \ 
5542            --load \ 
5643            test/backend/simple_express 
44+        - name : Choose Dockerfile 
45+         run : | 
46+           if [[ "${{ matrix.image }}" == "alpine"* ]]; then 
47+             echo "dockerfile=Dockerfile_alpine" >> $GITHUB_ENV 
48+           elif [[ "${{ matrix.image }}" == "amazonlinux"* ]]; then 
49+             echo "dockerfile=Dockerfile_amazonlinux" >> $GITHUB_ENV 
50+           else 
51+             echo "dockerfile=Dockerfile" >> $GITHUB_ENV 
52+           fi 
5753       - name : build nginx docker 
5854        run : | 
5955          cd instrumentation/nginx 
60-           docker buildx  build -t otel-nginx-test/nginx \ 
61-             --build-arg image=$(echo $ {{ matrix.os  }} | sed s/-/:/)  \ 
62-             -f test/Dockerfile. ${{ matrix.os }}.${{ matrix.nginx-rel  }} \ 
56+           docker build -t otel-nginx-test/nginx \ 
57+             --build-arg image=${{ matrix.image  }} \ 
58+             -f test/${{ env.dockerfile  }} \ 
6359            --cache-from type=local,src=/tmp/buildx-cache/nginx \ 
6460            --cache-to type=local,dest=/tmp/buildx-cache/nginx-new \ 
6561            --load \ 
@@ -73,18 +69,22 @@ jobs:
7369       - name : run tests 
7470        run : | 
7571          cd instrumentation/nginx/test/instrumentation 
72+           mix local.hex --force --if-missing 
73+           mix local.rebar --force --if-missing 
74+           mix deps.get 
7675          mix test 
7776       - name : copy artifacts 
7877        id : artifacts 
7978        run : | 
8079          cd instrumentation/nginx 
8180          mkdir -p /tmp/otel_ngx/ 
82-           docker buildx build -f test/Dockerfile.${{ matrix.os }}.${{ matrix.nginx-rel}} \ 
81+           docker build -f test/${{ env.dockerfile }} \ 
82+           --build-arg image=${{ matrix.image }} \ 
8383          --target export \ 
84-           --cache-from type=local,src=/tmp/.buildx-cache \ 
8584          --output type=local,dest=/tmp/otel_ngx . 
85+           echo "artifactName=otel_ngx_module-$(echo ${{ matrix.image }} | sed s/:/-/)-${{ matrix.nginx }}.so" >> $GITHUB_ENV 
8686       - name : upload artifacts 
87-         uses : actions/upload-artifact@v3  
87+         uses : actions/upload-artifact@v4  
8888        with :
89-           name : otel_ngx_module- ${{ matrix.os  }}-${{ matrix.nginx-rel }}.so 
89+           name : ${{ env.artifactName  }} 
9090          path : /tmp/otel_ngx/otel_ngx_module.so 
0 commit comments