From 408566088c0752f1602e0ef9669c8e439e8ab7db Mon Sep 17 00:00:00 2001 From: 0xkubectl Date: Tue, 23 Jul 2024 23:25:43 +0200 Subject: [PATCH 1/5] fix: add ci --- .github/workflows/check_pr.yaml | 36 +++++++++++++++++++++++++++++++++ rust-toolchain.toml | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/check_pr.yaml create mode 100644 rust-toolchain.toml 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" From 2516182fc88b8b89e3f97b41699981c0b8a4e10b Mon Sep 17 00:00:00 2001 From: 0xkubectl Date: Sat, 27 Jul 2024 18:17:35 +0200 Subject: [PATCH 2/5] fix: remove rust-toolchain.toml - deemed unessecary --- rust-toolchain.toml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 rust-toolchain.toml diff --git a/rust-toolchain.toml b/rust-toolchain.toml deleted file mode 100644 index 628740b..0000000 --- a/rust-toolchain.toml +++ /dev/null @@ -1,2 +0,0 @@ -[toolchain] -channel = "1.79.0" From da1944bcd43725b9fd5009a89685b2ded6266a09 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Sat, 28 Sep 2024 18:59:51 +0200 Subject: [PATCH 3/5] Check Compile even when formatting is wrong --- .github/workflows/check_pr.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check_pr.yaml b/.github/workflows/check_pr.yaml index 275913f..820e3ea 100644 --- a/.github/workflows/check_pr.yaml +++ b/.github/workflows/check_pr.yaml @@ -12,7 +12,6 @@ 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 From 98e58070d5dba4fc3d335427a5621a0aac879a75 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Sat, 28 Sep 2024 19:00:05 +0200 Subject: [PATCH 4/5] Update sccache-action to 0.0.6 --- .github/workflows/check_pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_pr.yaml b/.github/workflows/check_pr.yaml index 820e3ea..1721eb4 100644 --- a/.github/workflows/check_pr.yaml +++ b/.github/workflows/check_pr.yaml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - uses: moonrepo/setup-rust@v1 - name: Run sccache-cache - uses: mozilla-actions/sccache-action@v0.0.5 + uses: mozilla-actions/sccache-action@v0.0.6 - name: Configure sccache env var and set build profile to ephemeral build run: | echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV From af4aade8377a75cec1872f9372b790caf47aee2e Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Sat, 28 Sep 2024 19:00:13 +0200 Subject: [PATCH 5/5] Allow manual runs --- .github/workflows/check_pr.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check_pr.yaml b/.github/workflows/check_pr.yaml index 1721eb4..a04ef3b 100644 --- a/.github/workflows/check_pr.yaml +++ b/.github/workflows/check_pr.yaml @@ -7,6 +7,7 @@ on: push: branches: - main + workflow_dispatch: jobs: build_and_test: