Skip to content

Commit

Permalink
CI: Run everyday tests with pinned Rust version, not latest stable
Browse files Browse the repository at this point in the history
...in addition to our usual nightly.

Move the run commands for latest-stable to the Slow Tests (reusing the
cross-protocol-version testing job rather than making a new one).
  • Loading branch information
jrose-signal committed Jan 5, 2024
1 parent 3e8acec commit 48eb4c0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 23 deletions.
37 changes: 18 additions & 19 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ env:
CARGO_TERM_COLOR: always
NDK_VERSION: 25.2.9519653
RUST_BACKTRACE: 1
LIBSIGNAL_MINIMUM_SUPPORTED_RUST_VERSION: 1.72

jobs:
changes:
Expand Down Expand Up @@ -98,16 +99,17 @@ jobs:
matrix:
version: [nightly, stable]
include:
- version: stable
toolchain: "+stable"
- version: nightly
toolchain: "$(cat rust-toolchain)"
- version: stable
toolchain: "${LIBSIGNAL_MINIMUM_SUPPORTED_RUST_VERSION}"

steps:
- uses: actions/checkout@v3

- run: sudo apt-get update && sudo apt-get install protobuf-compiler

- run: rustup toolchain install $(cat rust-toolchain) --profile minimal --component rustfmt,clippy
if: matrix.version == 'nightly'
- run: rustup toolchain install ${{ matrix.toolchain }} --profile minimal --component rustfmt,clippy

- name: Cache locally-built tools
uses: actions/cache@v3
Expand Down Expand Up @@ -143,16 +145,16 @@ jobs:
if: matrix.version == 'nightly'

- name: Build
run: cargo ${{ matrix.toolchain }} build --workspace --features libsignal-ffi/signal-media --verbose
run: cargo +${{ matrix.toolchain }} build --workspace --features libsignal-ffi/signal-media --verbose

- name: Run tests
run: cargo ${{ matrix.toolchain }} test --workspace --all-features --verbose -- --include-ignored
run: cargo +${{ matrix.toolchain }} test --workspace --all-features --verbose -- --include-ignored

- name: Test run benches
run: cargo ${{ matrix.toolchain }} test --workspace --benches --all-features --verbose
run: cargo +${{ matrix.toolchain }} test --workspace --benches --all-features --verbose

- name: Build bins and examples
run: cargo ${{ matrix.toolchain }} build --workspace --bins --examples --all-features --verbose
run: cargo +${{ matrix.toolchain }} build --workspace --bins --examples --all-features --verbose

- name: Clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
Expand All @@ -168,14 +170,14 @@ jobs:
# See https://github.com/dtolnay/proc-macro2/issues/307 for an example.

- name: Check that the protocol fuzz target still builds
run: cargo +stable check --all-targets
run: cargo +${{ matrix.toolchain }} check --all-targets
working-directory: rust/protocol/fuzz
env:
RUSTFLAGS: --cfg fuzzing
if: matrix.version == 'stable'

- name: Check that the attest fuzz target still builds
run: cargo +stable check --all-targets
run: cargo +${{ matrix.toolchain }} check --all-targets
working-directory: rust/attest/fuzz
env:
RUSTFLAGS: --cfg fuzzing
Expand All @@ -195,24 +197,21 @@ jobs:
matrix:
version: [nightly, stable]
include:
- version: stable
toolchain: "+stable"
- version: nightly
toolchain: "$(cat rust-toolchain)"
- version: stable
toolchain: "${LIBSIGNAL_MINIMUM_SUPPORTED_RUST_VERSION}"

steps:
- uses: actions/checkout@v3

- run: sudo apt-get update && sudo apt-get install gcc-multilib g++-multilib protobuf-compiler

- run: rustup toolchain install $(cat rust-toolchain) --profile minimal --target i686-unknown-linux-gnu
if: matrix.version == 'nightly'

- name: Install Rust (stable)
run: rustup +stable target add i686-unknown-linux-gnu
if: matrix.version == 'stable'
- run: rustup toolchain install ${{ matrix.toolchain }} --profile minimal --target i686-unknown-linux-gnu

- name: Run tests (32-bit)
# Exclude signal-neon-futures because those tests run Node
run: cargo ${{ matrix.toolchain }} test --workspace --all-features --verbose --target i686-unknown-linux-gnu --exclude signal-neon-futures -- --include-ignored
run: cargo +${{ matrix.toolchain }} test --workspace --all-features --verbose --target i686-unknown-linux-gnu --exclude signal-neon-futures -- --include-ignored

java:
name: Java
Expand Down
21 changes: 17 additions & 4 deletions .github/workflows/slow_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ jobs:
# No import validation because it tries to build unsupported platforms (like 32-bit iOS).
run: pod lib lint --verbose --platforms=ios --include-podspecs=SignalCoreKit/SignalCoreKit.podspec --skip-import-validation

rust-protocol-cross-version-testing:
name: libsignal-protocol Cross-version Tests
rust-stable-testing:
name: Rust tests (using latest stable)
runs-on: ubuntu-latest
needs: [check-up-to-date]
if: ${{ always() && (needs.check-up-to-date.outputs.has-changes || github.event_name != 'schedule') }}
Expand All @@ -192,10 +192,23 @@ jobs:
- run: rustup +stable target add i686-unknown-linux-gnu

- name: Run tests
run: cargo +stable test --workspace --all-features --verbose -- --include-ignored

- name: Test run benches
run: cargo +stable test --workspace --benches --all-features --verbose

- name: Build bins and examples
run: cargo +stable build --workspace --bins --examples --all-features --verbose

- name: Run tests (32-bit)
# Exclude signal-neon-futures because those tests run Node
run: cargo +stable test --workspace --all-features --verbose --target i686-unknown-linux-gnu --exclude signal-neon-futures -- --include-ignored

- name: Run libsignal-protocol cross-version tests
run: cargo +stable test
working-directory: rust/protocol/cross-version-testing

- name: Run tests (32-bit)
- name: Run libsignal-protocol cross-version tests (32-bit)
run: cargo +stable test --target i686-unknown-linux-gnu
working-directory: rust/protocol/cross-version-testing

Expand All @@ -205,7 +218,7 @@ jobs:
report_failures:
name: Report Failures
runs-on: ubuntu-latest
needs: [java-docker, android-emulator-tests, node-docker, node-windows-arm64, swift-cocoapod, rust-protocol-cross-version-testing]
needs: [java-docker, android-emulator-tests, node-docker, node-windows-arm64, swift-cocoapod, rust-stable-testing]
if: ${{ failure() && github.event_name == 'schedule' }}

permissions:
Expand Down

0 comments on commit 48eb4c0

Please sign in to comment.