From: Jason Ish Date: Fri, 10 Sep 2021 16:14:47 +0000 (-0600) Subject: github-ci: prepare cbindgen in its own job X-Git-Tag: suricata-5.0.8~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d516380f45be426ebcc4963902d50f5fb9550bf;p=thirdparty%2Fsuricata.git github-ci: prepare cbindgen in its own job We already do this in master. For 5.0.x it should clear up any issues where our MSRV isn't suitable to build cbindgen. --- diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 6b35776fc8..f8a1445e4f 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -101,6 +101,30 @@ jobs: name: prep path: . + prepare-cbindgen: + name: Prepare cbindgen + runs-on: ubuntu-latest + steps: + - name: Cache ~/.cargo + uses: actions/cache@v1 + with: + path: ~/.cargo + key: cbindgen + - 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: Buliding 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@v2 + with: + name: prep + path: . + centos-8: name: CentOS 8 runs-on: ubuntu-latest @@ -801,7 +825,7 @@ jobs: name: Debian 10 runs-on: ubuntu-latest container: debian:10 - needs: prep + needs: [prep, prepare-cbindgen] steps: # Cache Rust stuff. - name: Cache cargo registry @@ -849,8 +873,6 @@ jobs: - name: Install Rust run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_VERSION_KNOWN -y - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: Install cbindgen - run: cargo install --force --debug --version 0.14.1 cbindgen - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 @@ -859,6 +881,11 @@ jobs: path: prep - run: tar xf prep/libhtp.tar.gz - run: tar xf prep/suricata-update.tar.gz + - name: Setup cbindgen + run: | + mkdir -p $HOME/.cargo/bin + cp prep/cbindgen $HOME/.cargo/bin + chmod 755 $HOME/.cargo/bin/cbindgen - run: ./autogen.sh - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests --enable-fuzztargets - run: make -j2 @@ -871,7 +898,7 @@ jobs: name: Debian 9 runs-on: ubuntu-latest container: debian:9 - needs: prep + needs: [prep, prepare-cbindgen] steps: - run: | apt update @@ -911,8 +938,6 @@ jobs: - name: Install Rust run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_VERSION_KNOWN -y - run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: Install cbindgen - run: cargo install --force --debug --version 0.14.1 cbindgen - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 with: @@ -920,6 +945,11 @@ jobs: path: prep - run: tar xf prep/libhtp.tar.gz - run: tar xf prep/suricata-update.tar.gz + - name: Setup cbindgen + run: | + mkdir -p $HOME/.cargo/bin + cp prep/cbindgen $HOME/.cargo/bin + chmod 755 $HOME/.cargo/bin/cbindgen - run: ./autogen.sh - run: CFLAGS="${DEFAULT_CFLAGS}" ./configure --enable-unittests - run: make -j2