diff --git a/.github/workflows/publish_crate.yml b/.github/workflows/publish_crate.yml new file mode 100644 index 0000000..cfdb811 --- /dev/null +++ b/.github/workflows/publish_crate.yml @@ -0,0 +1,42 @@ +name: Build and upload Rust crate + +# Build on every branch push, tag push, and pull request change: +on: [push, pull_request] + +jobs: + build_rust: + name: Build Rust stuff and run Rust tests + runs-on: ubuntu-latest + + steps: + - name: Checkout reposistory + uses: actions/checkout@v4 + + - name: Setup Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Check format + run: cargo fmt --check + + - name: Setup clippy + run: rustup component add clippy + + - name: Run clippy + run: cargo clippy --all-targets --all-features -- -D warnings + + - name: Build Rust package + run: cargo build --release --workspace + + - name: Build Rust tests + run: cargo test --workspace + + - name: Publish dry run + if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') + run: cargo publish --dry-run + + - name: Upload crate + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/tests_other_repo.yml b/.github/workflows/tests_other_repo.yml index 45710bd..faf6470 100644 --- a/.github/workflows/tests_other_repo.yml +++ b/.github/workflows/tests_other_repo.yml @@ -4,8 +4,8 @@ name: Test other repo on: [push, pull_request_target] jobs: - build_repo: - name: Test other repo + test_other_repo_py: + name: Test other repo (Python) runs-on: ubuntu-latest strategy: @@ -19,10 +19,10 @@ jobs: - name: Install Dependencies run: | - pip3 install -U maturin + python3 -m pip install -U maturin - name: Install local ipl3checksum - run: pip install . + run: python3 -m pip install . - name: Get extra dependencies uses: actions/checkout@v4 diff --git a/tests/check_recursive.py b/tests/check_recursive.py index ebdbe36..4a43925 100755 --- a/tests/check_recursive.py +++ b/tests/check_recursive.py @@ -59,11 +59,6 @@ def recursePaths(folder: Path) -> int: errors += recursePaths(subpath) continue - if subpath.parts[-2] == "drmario64" and subpath.name == "baserom.cn.z64": - # iQue has a wrong checksum for some reason - print(f"Skipping {subpath}") - continue - romBytes = subpath.read_bytes() romMagic = struct.unpack_from(f">I", romBytes, 0x0)[0]