diff --git a/.github/workflows/check-and-build.yml b/.github/workflows/build.yml similarity index 72% rename from .github/workflows/check-and-build.yml rename to .github/workflows/build.yml index 2461cd1..915d06c 100644 --- a/.github/workflows/check-and-build.yml +++ b/.github/workflows/build.yml @@ -1,53 +1,13 @@ -name: Check and Build +name: Build on: workflow_call: jobs: - spellcheck: - name: Check Grammar - runs-on: ubuntu-24.04 - - steps: - - uses: actions/checkout@v4 - - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: "codespell" - version: 1.0 - - run: codespell - - shellcheck: - name: Shell Check - runs-on: ubuntu-24.04 - - steps: - - uses: actions/checkout@v4 - - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: "shellcheck" - version: 1.0 - - run: find . -type f -name '*.sh' -not -path './assets/pkg/aur/*/src/*' | xargs shellcheck - - clangcheck: - name: Clang Check - runs-on: ubuntu-24.04 - - steps: - - uses: actions/checkout@v4 - - uses: awalsh128/cache-apt-pkgs-action@latest - with: - packages: "clang-format clang-tidy bear libpam0g-dev" - version: 1.0 - - run: bear -- make - - run: clang-format -ni src/*.c include/*.h - - run: clang-tidy -p . src/*.c include/*.h - build-linux-amd64: - name: Build for amd64 + name: amd64 runs-on: ubuntu-24.04 permissions: write-all - needs: [spellcheck, shellcheck, clangcheck] - steps: - uses: awalsh128/cache-apt-pkgs-action@latest with: @@ -64,10 +24,9 @@ jobs: retention-days: 1 build-linux-i386: - name: Build for i386 + name: i386 runs-on: ubuntu-24.04 permissions: write-all - needs: [spellcheck, shellcheck, clangcheck] steps: - uses: awalsh128/cache-apt-pkgs-action@latest @@ -90,10 +49,9 @@ jobs: retention-days: 1 build-linux-aarch64: - name: Build for aarch64 + name: aarch64 runs-on: ubuntu-24.04 permissions: write-all - needs: [spellcheck, shellcheck, clangcheck] steps: - uses: awalsh128/cache-apt-pkgs-action@latest with: @@ -118,10 +76,9 @@ jobs: retention-days: 1 build-linux-armv7: - name: Build for armv7 + name: armv7 runs-on: ubuntu-24.04 permissions: write-all - needs: [spellcheck, shellcheck, clangcheck] steps: - uses: awalsh128/cache-apt-pkgs-action@latest with: @@ -146,10 +103,9 @@ jobs: retention-days: 1 build-linux-riscv64: - name: Build for riscv64 + name: riscv64 runs-on: ubuntu-24.04 permissions: write-all - needs: [spellcheck, shellcheck, clangcheck] steps: - uses: awalsh128/cache-apt-pkgs-action@latest with: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..0a15b44 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,43 @@ +name: Check + +on: + workflow_call: + +jobs: + spellcheck: + name: Grammar + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v4 + - uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: "codespell" + version: 1.0 + - run: codespell + + shellcheck: + name: Shellcheck + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v4 + - uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: "shellcheck" + version: 1.0 + - run: find . -type f -name '*.sh' -not -path './assets/pkg/aur/*/src/*' | xargs shellcheck + + clangcheck: + name: Clang + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v4 + - uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: "clang-format clang-tidy bear libpam0g-dev" + version: 1.0 + - run: bear -- make + - run: clang-format -ni src/*.c include/*.h + - run: clang-tidy -p . src/*.c include/*.h diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index c44c01a..87bb98c 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -30,17 +30,23 @@ jobs: echo "VERSION=$MAKE_TAG" >> "$GITHUB_OUTPUT" - build: - name: Check and Build + check: + name: Check needs: release-checks - uses: ./.github/workflows/check-and-build.yml + uses: ./.github/workflows/check.yml + permissions: write-all + + build: + name: Build + needs: release-checks + uses: ./.github/workflows/build.yml permissions: write-all release: name: Make Release v${{ needs.release-checks.outputs.VERSION }} runs-on: ubuntu-24.04 permissions: write-all - needs: [ release-checks, build ] + needs: [ release-checks, check, build ] steps: - uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 427d926..0530da1 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,6 +1,3 @@ -# Kinda based by https://github.com/myrotvorets/set-commit-status-action/actions/runs/12344741285/workflow -name: Push Checks - on: push: branches: @@ -9,7 +6,11 @@ on: workflow_dispatch: jobs: - check-and-build: - name: Check and Build - uses: ./.github/workflows/check-and-build.yml + check: + name: Check + uses: ./.github/workflows/check.yml + permissions: write-all + build: + name: Build + uses: ./.github/workflows/build.yml permissions: write-all