]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
github-actions: switch dist builders to ubuntu 22.04
authorVictor Julien <vjulien@oisf.net>
Sun, 28 Jul 2024 05:26:36 +0000 (07:26 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 29 Jul 2024 04:14:13 +0000 (06:14 +0200)
Part of bumping MSRV.

22.04 is the first Ubuntu release to ship a new enough Sphinx.

.github/workflows/builds.yml
.github/workflows/docs.yml

index 6f54273fc6a953061217ce9fbaab2f69af56b977..f91effdc89c7f8ee3c3e21beeb35aeb9776e7aec 100644 (file)
@@ -312,7 +312,7 @@ jobs:
     name: AlmaLinux 9 Non-Bundled LibHTP
     runs-on: ubuntu-latest
     container: almalinux:9
-    needs: [prepare-deps, debian-12-dist]
+    needs: [prepare-deps, ubuntu-22-04-dist]
     steps:
       # Cache Rust stuff.
       - name: Cache cargo registry
@@ -491,7 +491,7 @@ jobs:
     name: CentOS Stream 9
     runs-on: ubuntu-latest
     container: quay.io/centos/centos:stream9
-    needs: [prepare-deps, debian-12-dist]
+    needs: [prepare-deps, ubuntu-22-04-dist]
     steps:
       # Cache Rust stuff.
       - name: Cache cargo registry
@@ -2128,7 +2128,7 @@ jobs:
     name: Ubuntu 20.04 (unsupported rust)
     runs-on: ubuntu-latest
     container: ubuntu:20.04
-    needs: debian-12-dist
+    needs: ubuntu-22-04-dist
     steps:
       - name: Cache ~/.cargo
         uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
@@ -2616,8 +2616,6 @@ jobs:
               autoconf \
               automake \
               build-essential \
-              cargo \
-              cbindgen \
               cmake \
               curl \
               dpdk-dev \
@@ -2646,7 +2644,6 @@ jobs:
               pkg-config \
               python3 \
               python3-yaml \
-              rustc \
               sphinx-doc \
               sphinx-common \
               texlive-latex-base \
@@ -2661,6 +2658,18 @@ jobs:
         with:
           name: prep
           path: prep
+      - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
+        with:
+          name: cbindgen
+          path: prep
+      - name: Install Rust
+        run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $(grep rust-version rust/Cargo.toml.in|sed 's/\"//g'|awk '{print $3}') -y
+      - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
+      - name: Setup cbindgen
+        run: |
+          mkdir -p $HOME/.cargo/bin
+          cp prep/cbindgen $HOME/.cargo/bin
+          chmod 755 $HOME/.cargo/bin/cbindgen
       - run: tar xf prep/libhtp.tar.gz
       - run: tar xf prep/suricata-update.tar.gz
       - run: tar xf prep/suricata-verify.tar.gz
@@ -2683,11 +2692,11 @@ jobs:
       - run: suricata-update -V
       - run: suricatasc -h
 
-  debian-12-dist:
-    name: Debian 12 Dist Builder
+  ubuntu-22-04-dist:
+    name: Ubuntu 22.04 Dist Builder
     runs-on: ubuntu-latest
-    container: debian:12
-    needs: [prepare-deps]
+    container: ubuntu:22.04
+    needs: [prepare-deps, prepare-cbindgen]
     steps:
       # Cache Rust stuff.
       - name: Cache cargo registry
@@ -2706,7 +2715,6 @@ jobs:
               automake \
               build-essential \
               cargo \
-              cbindgen \
               cmake \
               curl \
               git \
@@ -2749,6 +2757,16 @@ jobs:
           path: prep
       - run: tar xf prep/libhtp.tar.gz
       - run: tar xf prep/suricata-update.tar.gz
+      - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
+        with:
+          name: cbindgen
+          path: prep
+      - name: Setup cbindgen
+        run: |
+          mkdir -p $HOME/.cargo/bin
+          cp prep/cbindgen $HOME/.cargo/bin
+          chmod 755 $HOME/.cargo/bin/cbindgen
+          echo "$HOME/.cargo/bin" >> $GITHUB_PATH
       - run: ./autogen.sh
       - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure
       - run: make dist
@@ -3221,7 +3239,7 @@ jobs:
     name: PF_RING
     runs-on: ubuntu-latest
     container: almalinux:9
-    needs: [prepare-deps, debian-12-dist]
+    needs: [prepare-deps, ubuntu-22-04-dist]
     steps:
       # Cache Rust stuff.
       - name: Cache cargo registry
index 95c766dca0767c13ccf3b0706c3ce8f3e665c9e7..ea1d86262538ddf16333754b6cc441465b3ff71b 100644 (file)
@@ -33,11 +33,35 @@ jobs:
     name: Prepare dependencies
     uses: ./.github/workflows/prepare-deps.yml
 
-  debian-12-dist:
-    name: Debian 12 Dist Builder
+  prepare-cbindgen:
+    name: Prepare cbindgen
     runs-on: ubuntu-latest
-    container: debian:12
-    needs: [prepare-deps]
+    steps:
+      - name: Cache ~/.cargo
+        uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2
+        with:
+          path: ~/.cargo
+          key: ${{ github.job }}-cargo
+      - name: Installing Rust
+        run: |
+          curl https://sh.rustup.rs -sSf | sh -s -- -y
+          echo "$HOME/.cargo/bin" >> $GITHUB_PATH
+          rustup target add x86_64-unknown-linux-musl
+      - name: Building static cbindgen for Linux
+        run: |
+          cargo install --target x86_64-unknown-linux-musl --debug cbindgen
+          cp $HOME/.cargo/bin/cbindgen .
+      - name: Uploading prep archive
+        uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
+        with:
+          name: cbindgen
+          path: .
+
+  ubuntu-22-04-dist:
+    name: Ubuntu 22.04 Dist Builder
+    runs-on: ubuntu-latest
+    container: ubuntu:22.04
+    needs: [prepare-deps, prepare-cbindgen]
     steps:
       # Cache Rust stuff.
       - name: Cache cargo registry
@@ -56,7 +80,6 @@ jobs:
               automake \
               build-essential \
               cargo \
-              cbindgen \
               cmake \
               curl \
               git \
@@ -97,6 +120,16 @@ jobs:
         with:
           name: prep
           path: prep
+      - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
+        with:
+          name: cbindgen
+          path: prep
+      - name: Setup cbindgen
+        run: |
+          mkdir -p $HOME/.cargo/bin
+          cp prep/cbindgen $HOME/.cargo/bin
+          chmod 755 $HOME/.cargo/bin/cbindgen
+          echo "$HOME/.cargo/bin" >> $GITHUB_PATH
       - run: tar xf prep/libhtp.tar.gz
       - run: tar xf prep/suricata-update.tar.gz
       - run: ./autogen.sh