ci: build with --locked (#503)

This commit is contained in:
Marshall Porter 2026-08-16 15:55:31 -07:00 committed by GitHub
commit 65ec680ea3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 10 deletions

View file

@ -30,23 +30,23 @@ jobs:
- run: mkdir artifacts
- name: Build with default features
run: |
cargo build
cargo build --locked
cp target/debug/tldr${{ matrix.exe_suffix}} artifacts/tldr-default${{ matrix.exe_suffix}}
- name: Build with logging and Rustls with webpki roots
run: |
cargo build --features logging,rustls-with-webpki-roots --no-default-features
cargo build --locked --features logging,rustls-with-webpki-roots --no-default-features
cp target/debug/tldr${{ matrix.exe_suffix}} artifacts/tldr-logging-rustls-webpki${{ matrix.exe_suffix}}
- name: Build with native TLS backend
run: |
# expects runners have the proper Native SSL library
cargo build --features native-tls --no-default-features
cargo build --locked --features native-tls --no-default-features
cp target/debug/tldr${{ matrix.exe_suffix}} artifacts/tldr-native-tls${{ matrix.exe_suffix}}
- uses: actions/upload-artifact@v7
with:
name: tldr-debug-build-${{ matrix.platform }}-rust-${{ matrix.toolchain }}
path: artifacts/
- name: Run tests
run: cargo test -- --test-threads 1
run: cargo test --locked -- --test-threads 1
clippy:
name: run clippy lints
@ -58,7 +58,7 @@ jobs:
toolchain: stable
components: clippy
- name: run clippy lints
run: cargo clippy --all-targets --features logging
run: cargo clippy --locked --all-targets --features logging
fmt:
name: run rustfmt
@ -86,10 +86,10 @@ jobs:
with:
toolchain: stable
- name: Build
run: cargo build
run: cargo build --locked
- name: Ensure that docs can be built
run: cd docs && mdbook build
- name: Generate usage string
run: cargo run -- --help > docs/src/usage-actual.txt
run: cargo run --locked -- --help > docs/src/usage-actual.txt
- name: Ensure that usage string is up to date
run: diff docs/src/usage{,-actual}.txt

View file

@ -70,7 +70,7 @@ jobs:
- name: Pull Docker image
run: docker pull messense/rust-musl-cross:${{ matrix.arch }}-${{ matrix.libc }}
- name: Build in Docker
run: docker run --rm -i -v "$(pwd)":/home/rust/src messense/rust-musl-cross:${{ matrix.arch }}-${{ matrix.libc }} cargo build --release
run: docker run --rm -i -v "$(pwd)":/home/rust/src messense/rust-musl-cross:${{ matrix.arch }}-${{ matrix.libc }} cargo build --locked --release
- name: Strip binary
run: docker run --rm -i -v "$(pwd)":/home/rust/src messense/rust-musl-cross:${{ matrix.arch }}-${{ matrix.libc }} musl-strip -s /home/rust/src/target/${{ matrix.arch }}-unknown-linux-${{ matrix.libc }}/release/tldr
- uses: actions/upload-artifact@v7
@ -93,7 +93,7 @@ jobs:
toolchain: stable
targets: "${{ matrix.arch }}-apple-darwin"
- name: Build
run: cargo build --release --target ${{ matrix.arch }}-apple-darwin
run: cargo build --locked --release --target ${{ matrix.arch }}-apple-darwin
- uses: actions/upload-artifact@v7
with:
name: "tealdeer-macos-${{ matrix.arch }}"
@ -116,7 +116,7 @@ jobs:
toolchain: stable
targets: "${{ matrix.arch }}-pc-windows-msvc"
- name: Build
run: cargo build --release --target ${{ matrix.arch }}-pc-windows-msvc
run: cargo build --locked --release --target ${{ matrix.arch }}-pc-windows-msvc
- uses: actions/upload-artifact@v7
with:
name: "tealdeer-windows-${{ matrix.arch }}-msvc"