From a44c3e0737ff872c3f64a868c5102b6ece2186c1 Mon Sep 17 00:00:00 2001 From: Eugene Date: Sat, 24 Feb 2024 15:52:43 +0400 Subject: [PATCH 1/4] fix doctest --- crates/byond/src/tgm/parsing.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/byond/src/tgm/parsing.rs b/crates/byond/src/tgm/parsing.rs index 1213bf8c..82e5fd7e 100644 --- a/crates/byond/src/tgm/parsing.rs +++ b/crates/byond/src/tgm/parsing.rs @@ -152,7 +152,8 @@ where /// Parses an assignment in the form of `left = right`, ignoring whitespace. /// -/// ``` +/// ```ignore +/// # // docs cant see and test `assignment` (probably because not pub) /// assert_eq!(assignment(tag("you"), tag("awesome"))("you= awesome"), Ok(("you= awesome", ("you", "awesome")))) /// ``` fn assignment<'a, FL: 'a, FR: 'a, L, R, E: 'a + ParseError<&'a str> + ContextError<&'a str>>( From 50b96004f7c41d610338405895ddd8bd76a7bd26 Mon Sep 17 00:00:00 2001 From: Eugene Date: Sat, 24 Feb 2024 15:58:15 +0400 Subject: [PATCH 2/4] add test CI step, update actions --- .github/workflows/ci.yml | 38 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2053cae4..126b3d6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,34 +14,30 @@ jobs: formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo fmt --check check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: Rust cache - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - uses: r7kamura/rust-problem-matchers@v1 + - run: cargo clippy -- -D warnings + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 - name: Install native system dependencies run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev if: runner.os == 'linux' - - uses: r7kamura/rust-problem-matchers@b5092889692373e09c98a0aeb380a044a651ab86 - - name: Run clippy and cargo checks - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + - uses: r7kamura/rust-problem-matchers@v1 + - run: cargo test --workspace docker: runs-on: ubuntu-latest From f79768acd5c535bd729a05d52c4c01ee3b9f9a83 Mon Sep 17 00:00:00 2001 From: Eugene Date: Sat, 24 Feb 2024 16:02:39 +0400 Subject: [PATCH 3/4] system deps are needed even for clippy --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 126b3d6c..7db07d7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 + - name: Install native system dependencies + run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev + if: runner.os == 'linux' - uses: r7kamura/rust-problem-matchers@v1 - run: cargo clippy -- -D warnings From 178a7e0032ca0e5e92d5a2a608682326990cf9af Mon Sep 17 00:00:00 2001 From: Eugene Date: Sat, 24 Feb 2024 16:12:58 +0400 Subject: [PATCH 4/4] prepare to test on other OSes --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7db07d7d..08444eee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,11 @@ jobs: - run: cargo clippy -- -D warnings test: - runs-on: ubuntu-latest + strategy: + matrix: + # TODO: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable