From fd9f80f3e28bf611b16bddf37ccf775a0279b6b9 Mon Sep 17 00:00:00 2001 From: Walid Kayhal <3347810+waliid@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:10:58 +0100 Subject: [PATCH] Use Ubuntu runner for check-quality and build-documentation jobs --- .github/workflows/pull-request.yml | 50 +++++++++++++++--------------- Scripts/check-quality.sh | 10 ++++-- hooks/pre-commit | 2 +- 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2d9bc251..9a41903e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -4,38 +4,38 @@ name: Pull Request on: push # yamllint disable-line rule:truthy jobs: - # check-quality: - # name: "๐Ÿ”Ž Check quality" - # runs-on: macos-latest - # steps: - # - name: Checkout code - # uses: actions/checkout@v4 + check-quality: + name: "๐Ÿ”Ž Check quality" + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run the quality check + run: make check-quality + + build-documentation: + name: "๐Ÿ“š Build documentation" + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 - # - name: Run the quality check - # run: make check-quality + - name: Build the documentation + run: make doc - # build-documentation: - # name: "๐Ÿ“š Build documentation" + # tests: + # name: "๐Ÿงช Tests" # runs-on: macos-latest + # strategy: + # matrix: + # platform: [ios, tvos] # steps: # - name: Checkout code # uses: actions/checkout@v4 - # - name: Build the documentation - # run: make doc - - tests: - name: "๐Ÿงช Tests" - runs-on: macos-latest - strategy: - matrix: - platform: [ios, tvos] - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Run tests - run: make test-${{ matrix.platform }} + # - name: Run tests + # run: make test-${{ matrix.platform }} # archive-demos: # name: "๐Ÿ“ฆ Archives" diff --git a/Scripts/check-quality.sh b/Scripts/check-quality.sh index e31a467b..88168d5f 100755 --- a/Scripts/check-quality.sh +++ b/Scripts/check-quality.sh @@ -1,6 +1,12 @@ #!/bin/bash -set -e +set -xe + +echo "==========================================" +echo "$PATH" +which pkgx +export PATH="/usr/local/bin:$PATH" +echo "==========================================" eval "$(pkgx --shellcode)" env +swiftlint +rubocop +shellcheck +markdownlint +yamllint @@ -8,7 +14,7 @@ env +swiftlint +rubocop +shellcheck +markdownlint +yamllint echo "... checking Swift code..." if [ $# -eq 0 ]; then swiftlint --quiet --strict -elif [[ "$1" == "only-changes" ]]; then +elif [[ "$1" == "--only-changes" ]]; then git diff --staged --name-only | grep ".swift$" | xargs swiftlint lint --quiet --strict fi echo "... checking Ruby scripts..." diff --git a/hooks/pre-commit b/hooks/pre-commit index b9a31b50..e68d777f 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -1,7 +1,7 @@ #!/bin/sh # Quality check -if Scripts/check-quality.sh only-changes; then +if Scripts/check-quality.sh --only-changes; then echo "โœ… Quality checked" else echo "โŒ Quality check failed"