Skip to content

Commit

Permalink
refactor: enable cargo's sparse protocol in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluisq committed Mar 10, 2023
1 parent 7490697 commit 200fce0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .cirrus.yml
Expand Up @@ -9,6 +9,8 @@ task:
only_if: $CIRRUS_TAG == ''
env:
RUSTFLAGS: -Dwarnings
# Cargo's sparse protocol from 1.68.0 onwards
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
matrix:
- name: freebsd-amd64-test
env:
Expand Down Expand Up @@ -41,6 +43,8 @@ task:
only_if: $CIRRUS_TAG != ''
env:
RUSTFLAGS: -Dwarnings
# Cargo's sparse protocol from 1.68.0 onwards
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
GITHUB_TOKEN: ENCRYPTED[d1766ef328d83729917d2ffb875d64c35d1c0177edf8f32e66ec464daf5c1b7b145d65fc6c044a73fffe2235d3b38349]
matrix:
- name: freebsd-amd64-release
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/devel.yml
Expand Up @@ -14,6 +14,8 @@ jobs:
name: test
runs-on: ${{ matrix.os }}
env:
# Cargo's sparse protocol from 1.68.0 onwards
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_BIN: cargo
# When CARGO_BIN is set to CROSS, this is set to `--target matrix.target`
TARGET_FLAGS: ""
Expand Down Expand Up @@ -148,11 +150,17 @@ jobs:
echo "SKIP_TESTS=yes" >> $GITHUB_ENV
- name: Run tests
shell: bash
if: env.SKIP_TESTS == ''
run: ${{ env.CARGO_BIN }} test --verbose ${{ env.TARGET_FLAGS }}
run: |
if [[ "${{ matrix.build }}" == "pinned" ]]; then unset CARGO_REGISTRIES_CRATES_IO_PROTOCOL; fi
${{ env.CARGO_BIN }} test --verbose ${{ env.TARGET_FLAGS }}
- name: Run build
run: ${{ env.CARGO_BIN }} build --verbose ${{ env.TARGET_FLAGS }}
shell: bash
run: |
if [[ "${{ matrix.build }}" == "pinned" ]]; then unset CARGO_REGISTRIES_CRATES_IO_PROTOCOL; fi
${{ env.CARGO_BIN }} build --verbose ${{ env.TARGET_FLAGS }}
checks:
name: checks
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Expand Up @@ -37,6 +37,8 @@ jobs:
needs: ['create-release']
runs-on: ${{ matrix.os }}
env:
# Cargo's sparse protocol from 1.68.0 onwards
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
# For some builds, we use cross to test on 32-bit and big-endian
# systems.
CARGO_BIN: cargo
Expand Down

0 comments on commit 200fce0

Please sign in to comment.