From 6e7f081bd38bea6379c225f8e2aea769e6cbb6d2 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sun, 7 Feb 2021 18:12:06 +0000 Subject: [PATCH] Use cbindgen included in GitHub Actions runners Building cbindgen takes a few minutes on Windows, so avoid that by using the version included in the GitHub Actions runner. The version include in the runners isn't the same as what the build expects, but hopefully the differences aren't significant. --- .github/workflows/ci.yml | 25 ++++--------------------- .github/workflows/release.yml | 20 -------------------- 2 files changed, 4 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87b418ea..7cefd7a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,6 @@ on: env: CARGO_TERM_COLOR: always - CBINDGEN_VERSION: 0.13.2 MSVC_CONFIG: RelWithDebInfo jobs: @@ -40,12 +39,6 @@ jobs: ~/.cargo/git key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Install cbindgen - run: | - wget -P "$HOME/.local/bin" https://github.com/eqrion/cbindgen/releases/download/v0.13.2/cbindgen - chmod +x "$HOME/.local/bin/cbindgen" - echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Get descriptive libloot version id: get-libloot-version shell: bash @@ -86,7 +79,10 @@ jobs: ./libloot_tests - name: Install packages for building docs - run: pip3 install --user -r docs/requirements.txt + shell: bash + run: | + pip3 install --user -r docs/requirements.txt + echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Build docs run: sphinx-build -b html docs build/docs/html @@ -129,22 +125,9 @@ jobs: ~/.cargo/git key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cbindgen - id: cache-cbindgen - uses: actions/cache@v2 - with: - path: ~/.cargo/bin/cbindgen.exe - key: ${{ runner.os }}-cbindgen-${{ env.CBINDGEN_VERSION }} - - name: Install Rust i686-pc-windows-msvc target run: rustup target add i686-pc-windows-msvc - - name: Install cbindgen - run: | - cargo install cbindgen --version ${{ env.CBINDGEN_VERSION }} - echo "~/.cargo/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - if: steps.cache-cbindgen.outputs.cache-hit != 'true' - - name: Get descriptive libloot version id: get-libloot-version shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6605dd7..b503869b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,6 @@ on: env: CARGO_TERM_COLOR: always - CBINDGEN_VERSION: 0.13.2 MSVC_CONFIG: RelWithDebInfo jobs: @@ -55,12 +54,6 @@ jobs: ~/.cargo/git key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Install cbindgen - run: | - wget -P "$HOME/.local/bin" https://github.com/eqrion/cbindgen/releases/download/v0.13.2/cbindgen - chmod +x "$HOME/.local/bin/cbindgen" - echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Get descriptive libloot version id: get-libloot-version shell: bash @@ -148,22 +141,9 @@ jobs: target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cbindgen - id: cache-cbindgen - uses: actions/cache@v2 - with: - path: ~/.cargo/bin/cbindgen.exe - key: ${{ runner.os }}-cbindgen-${{ env.CBINDGEN_VERSION }} - - name: Install Rust i686-pc-windows-msvc target run: rustup target add i686-pc-windows-msvc - - name: Install cbindgen - run: | - cargo install cbindgen --version ${{ env.CBINDGEN_VERSION }} - echo "~/.cargo/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - if: steps.cache-cbindgen.outputs.cache-hit != 'true' - - name: Get descriptive libloot version id: get-libloot-version shell: bash