From 913eff5b2f87ea8e0389ce634306994fabdd2aee Mon Sep 17 00:00:00 2001 From: curquiza Date: Mon, 19 Dec 2022 10:46:29 +0100 Subject: [PATCH] Use ubuntu-18.04 container in rust tests --- .github/workflows/flaky.yml | 12 ++++- .github/workflows/rust.yml | 45 ++++++++++++++++--- .../workflows/update-cargo-toml-version.yml | 2 +- 3 files changed, 51 insertions(+), 8 deletions(-) diff --git a/.github/workflows/flaky.yml b/.github/workflows/flaky.yml index fadd6bf96..9da5a6854 100644 --- a/.github/workflows/flaky.yml +++ b/.github/workflows/flaky.yml @@ -6,10 +6,20 @@ on: jobs: flaky: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest + container: + image: ubuntu:18.04 steps: - uses: actions/checkout@v3 + - name: Install needed dependencies + run: | + apt-get update && apt-get install -y curl + apt-get install build-essential -y + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true - name: Install cargo-flaky run: cargo install cargo-flaky - name: Run cargo flaky 100 times diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5c5ca827f..ea2b0bbff 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,13 +15,41 @@ env: RUSTFLAGS: "-D warnings" jobs: - tests: + test-linux: + name: Tests on ubuntu-18.04 + runs-on: ubuntu-latest + container: + image: ubuntu:18.04 + steps: + - uses: actions/checkout@v3 + - name: Install rustup + run: | + apt-get update && apt-get install -y curl + apt-get install build-essential -y + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Cache dependencies + uses: Swatinem/rust-cache@v2.2.0 + - name: Run cargo check without any default features + uses: actions-rs/cargo@v1 + with: + command: build + args: --locked --release --no-default-features + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --locked --release + + test-others: name: Tests on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-18.04, macos-latest, windows-latest] + os: [macos-latest, windows-latest] steps: - uses: actions/checkout@v3 - name: Cache dependencies @@ -40,12 +68,17 @@ jobs: # We run tests in debug also, to make sure that the debug_assertions are hit test-debug: name: Run tests in debug - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest + container: + image: ubuntu:18.04 steps: - uses: actions/checkout@v3 + - name: Install rustup + run: | + apt-get update && apt-get install -y curl + apt-get install build-essential -y - uses: actions-rs/toolchain@v1 with: - profile: minimal toolchain: stable override: true - name: Cache dependencies @@ -58,7 +91,7 @@ jobs: clippy: name: Run Clippy - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -77,7 +110,7 @@ jobs: fmt: name: Run Rustfmt - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/update-cargo-toml-version.yml b/.github/workflows/update-cargo-toml-version.yml index e823a0b23..6446a366a 100644 --- a/.github/workflows/update-cargo-toml-version.yml +++ b/.github/workflows/update-cargo-toml-version.yml @@ -16,7 +16,7 @@ jobs: update-version-cargo-toml: name: Update version in Cargo.toml files - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1