From 2319374b02e6b1d2db47ea59a52d3d96a5ea437d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 6 Aug 2023 20:54:48 -0400 Subject: add github actions --- .github/workflows/tests.yaml | 67 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/tests.yaml diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..c02a77b --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,67 @@ +name: tests +on: + push: + branches: [main] + pull_request: {} +env: + RUST_BACKTRACE: 1 +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo build --all-targets + build-musl: + runs-on: ubuntu-latest + steps: + - run: sudo apt-get install clang-11 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-musl + - run: TARGET_CC=clang-11 TARGET_AR=llvm-ar-11 cargo build --all-targets --target x86_64-unknown-linux-musl + build-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo build --all-targets + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo test + test-musl: + runs-on: ubuntu-latest + steps: + - run: sudo apt-get install clang-11 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-musl + - run: TARGET_CC=clang-11 TARGET_AR=llvm-ar-11 cargo test --target x86_64-unknown-linux-musl + test-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo test + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy, rustfmt + - run: cargo install --locked --debug cargo-deny + - run: cargo clippy --all-targets -- -Dwarnings + - run: cargo fmt --check + - run: cargo deny check + doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - run: cargo doc -- cgit v1.2.3-54-g00ecf