diff --git a/.github/labeler.yml b/.github/labeler.yml index 31043c59..76326b39 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -5,10 +5,13 @@ ci: - .pre-commit-config.yaml protocol: - - src/protocols/** + - crates/lib/src/protocols/** game: - - src/games/** + - crates/lib/src/games/** + +cli: + - crates/cli/** crate: - Cargo.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85ce36d3..7e9192e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,9 +31,9 @@ jobs: shared-key: "cargo-deps" cache-targets: false - name: Run Build - run: cargo build --verbose --bins --lib --examples --all-features + run: cargo check --verbose --workspace --bins --lib --examples --all-features - name: Run Tests - run: cargo test --verbose --bins --lib --examples --all-features + run: cargo test --verbose --workspace --bins --lib --examples --all-features build: runs-on: ubuntu-latest needs: [ "build_first" ] @@ -61,9 +61,9 @@ jobs: shared-key: "cargo-deps" cache-targets: false - name: Run Build - run: cargo build --verbose --bins --lib ${{ matrix.build_type }} + run: cargo check --workspace --verbose --bins --lib ${{ matrix.build_type }} build_msrv: - name: "Build using MSRV" + name: "Build using MSRV (lib only)" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -74,7 +74,7 @@ jobs: toolchain: 1.65.0 override: true - name: Run MSRV - run: cargo build + run: cargo check -p gamedig formatting: name: "Check code formatting" runs-on: ubuntu-latest @@ -105,10 +105,10 @@ jobs: uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --bins --lib --examples --all-features + args: --workspace --bins --lib --examples --all-features if: ${{ !env.ACT }} # skip during local actions testing - name: Run clippy (local) - run: cargo clippy --verbose --bins --lib --examples --all-features + run: cargo clippy --workspace --verbose --bins --lib --examples --all-features if: ${{ env.ACT }} # only run during local actions testing doc: name: "Check rustdoc" @@ -121,6 +121,6 @@ jobs: shared-key: "cargo-deps" cache-targets: false - name: "Run cargo doc" - run: cargo doc + run: cargo doc --workspace env: RUSTDOCFLAGS: "-D warnings" diff --git a/.github/workflows/node-badge.yml b/.github/workflows/node-badge.yml index b6865eea..b0b33afc 100644 --- a/.github/workflows/node-badge.yml +++ b/.github/workflows/node-badge.yml @@ -39,7 +39,7 @@ jobs: # Calculate how many of those games we have definitions for rust_games_count=0 for game in $node_games; do - if grep "\"$game\" *=>" ./src/games/definitions.rs; then + if grep "\"$game\" *=>" ./crates/lib/src/games/definitions.rs; then rust_games_count=$(( rust_games_count + 1 )) fi done diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7449aee9..6e7adc33 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,25 +8,25 @@ repos: language: system files: '[.]rs$' pass_filenames: false - entry: rustup run --install nightly-2023-07-09 cargo-clippy -- -- -D warnings + entry: rustup run --install nightly-2023-07-09 cargo-clippy -- --workspace --all-features -- -D warnings - id: build-no-features name: Check crate build with no features language: system files: '[.]rs$' pass_filenames: false - entry: cargo build --no-default-features + entry: cargo check --workspace --no-default-features - id: build-all-features name: Check crate builds with all features language: system files: '[.]rs$' pass_filenames: false - entry: cargo build --all-features --lib --bins --examples + entry: cargo check --workspace --all-features --lib --bins --examples - id: test name: Check tests pass language: system files: '[.]rs$' pass_filenames: false - entry: cargo test --bins --lib --examples --all-features + entry: cargo test --workspace --bins --lib --examples --all-features - id: format name: Check rustfmt language: system @@ -34,11 +34,11 @@ repos: pass_filenames: false entry: rustup run --install nightly-2023-07-09 cargo-fmt --check - id: msrv - name: Check MSRV compiles + name: Check MSRV compiles (lib only) language: system files: '[.]rs$' pass_filenames: false - entry: rustup run --install 1.65 cargo build + entry: rustup run --install 1.65 cargo check -p gamedig - id: docs name: Check rustdoc compiles language: system diff --git a/Cargo.toml b/Cargo.toml index 8d744031..a729bd25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,4 +3,6 @@ name = "gamedig-workspace" members = [ "crates/cli", "crates/lib", -] \ No newline at end of file +] +# Edition 2021, uses resolver = 2 +resolver = "2"