diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 318fa12c7..6843c290f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,9 +7,17 @@ on: pull_request: types: [opened, synchronize] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - test-burn-std: + tests: runs-on: ubuntu-latest + strategy: + matrix: + rust: [stable, 1.71.0] + test: [std, no_std] steps: - name: free disk space run: | @@ -20,18 +28,19 @@ jobs: df -h - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: install rust - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@master with: components: rustfmt, clippy + toolchain: ${{ matrix.rust }} - name: caching uses: Swatinem/rust-cache@v2 with: key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} - prefix-key: "v1-rust" + prefix-key: "v4-rust" - name: install llvmpipe and lavapipe run: | @@ -41,40 +50,13 @@ jobs: sudo apt install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers - name: run checks & tests - run: ./run-checks.sh std - - test-burn-no-std: - runs-on: ubuntu-latest - steps: - - name: free disk space - run: | - df -h - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - df -h - - - name: checkout - uses: actions/checkout@v3 - - - name: install rust - uses: dtolnay/rust-toolchain@stable - with: - components: rustfmt, clippy - - - name: caching - uses: Swatinem/rust-cache@v2 - with: - key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} - - - name: run checks & tests - run: ./run-checks.sh no_std + run: RUST_MATRIX=${{ matrix.rust }} ./run-checks.sh ${{ matrix.test }} check-typos: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: run spelling checks using typos run: ./run-checks.sh typos diff --git a/README.md b/README.md index e52e125dc..e24893673 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Test Status](https://github.com/burn-rs/burn/actions/workflows/test.yml/badge.svg)](https://github.com/burn-rs/burn/actions/workflows/test.yml) [![Documentation](https://docs.rs/burn/badge.svg)](https://docs.rs/burn) [![Current Crates.io Version](https://img.shields.io/crates/v/burn.svg)](https://crates.io/crates/burn) -[![Rust Version](https://img.shields.io/badge/Rust-1.65.0+-blue)](https://releases.rs/docs/1.65.0) +[![Rust Version](https://img.shields.io/badge/Rust-1.71.0+-blue)](https://releases.rs/docs/1.71.0) ![license](https://shields.io/badge/license-MIT%2FApache--2.0-blue) This library strives to serve as a comprehensive **deep learning framework**, offering exceptional diff --git a/burn/Cargo.toml b/burn/Cargo.toml index 0ea1aed16..5e9c704d5 100644 --- a/burn/Cargo.toml +++ b/burn/Cargo.toml @@ -9,6 +9,7 @@ name = "burn" readme = "README.md" repository = "https://github.com/burn-rs/burn" version = "0.9.0" +rust-version = "1.71" [features] default = [ diff --git a/scripts/run-checks.rs b/scripts/run-checks.rs index a2bb9fc82..51ba966d3 100644 --- a/scripts/run-checks.rs +++ b/scripts/run-checks.rs @@ -130,6 +130,9 @@ fn cargo_fmt() { // Run cargo clippy command fn cargo_clippy() { + if std::env::var("RUST_MATRIX").map_or(false, |matrix| matrix != "stable") { + return; + } // Run cargo clippy run_cargo( "clippy", @@ -320,7 +323,8 @@ fn main() { Some("no_std") => no_std_checks(), Some("typos") => check_typos(), Some("examples") => check_examples(), - Some(_) | None => { + Some(other) => panic!("Unexpected test type: {}", other), + None => { /* Run all checks */ check_typos(); std_checks();