diff --git a/.github/workflows/check_pr.yaml b/.github/workflows/check_pr.yaml new file mode 100644 index 0000000..275913f --- /dev/null +++ b/.github/workflows/check_pr.yaml @@ -0,0 +1,36 @@ +name: CI Check + +on: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + build_and_test: + runs-on: ubuntu-latest + name: Build and Test + needs: check-fmt + steps: + - uses: actions/checkout@v4 + - uses: moonrepo/setup-rust@v1 + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.5 + - name: Configure sccache env var and set build profile to ephemeral build + run: | + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV + - run: cargo build --all + - run: cargo test --all + + check-fmt: + runs-on: ubuntu-latest + name: Check formatting + steps: + - uses: actions/checkout@v4 + - uses: moonrepo/setup-rust@v1 + with: + components: rustfmt + - run: cargo fmt --all -- --check diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..628740b --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.79.0"