Skip to content

Commit

Permalink
ci for rust
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Dec 15, 2023
1 parent ca84eb5 commit f6fba0e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 9 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish_crate.yml
Original file line number Diff line number Diff line change
@@ -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 }}
8 changes: 4 additions & 4 deletions .github/workflows/tests_other_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
5 changes: 0 additions & 5 deletions tests/check_recursive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit f6fba0e

Please sign in to comment.