From 23f62111cf39e0a3e341307059d314232c995f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20Kiiskil=C3=A4?= Date: Tue, 15 Oct 2024 11:31:40 +0300 Subject: [PATCH] Update CI - separate misspell, use re-usable action Update the actions/checkout on the shellcheck. Install shellcheck before trying to use. Use the client runners. --- .github/workflows/misspell.yml | 22 ++++++++++++++++++++++ .github/workflows/shellcheck.yml | 23 +++-------------------- 2 files changed, 25 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/misspell.yml diff --git a/.github/workflows/misspell.yml b/.github/workflows/misspell.yml new file mode 100644 index 0000000..6d0a948 --- /dev/null +++ b/.github/workflows/misspell.yml @@ -0,0 +1,22 @@ +name: Misspell +on: + push: + workflow_dispatch: + +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: perts-misspell-'${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true + +jobs: + misspell: + runs-on: client + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Remove folders we do not want to check (as we do not control them) + run: rm -rf node_modules vendor-licenses.txt + - name: Misspell + uses: PelionIoT/actions/.github/actions/misspell@main + with: + exceptions: "mosquitto" diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 25158d9..ca2b9bb 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -11,26 +11,9 @@ concurrency: cancel-in-progress: true jobs: run-shellcheck: - runs-on: ubuntu-22.04 + runs-on: client steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - run: sudo apt-get update && sudo apt-get install -y shellcheck - run: shellcheck --version - run: shellcheck scripts/*.sh - run-misspell: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Run misspell - run: | - curl -L -o ./install-misspell.sh https://git.io/misspell - sh ./install-misspell.sh - bin/misspell -i mosquitto,Stichting,Mathematisch scripts test_cases test-configs utils conf >misspell.log - echo "### misspell" >>$SUMMARY_FILE - cat misspell.log >>$SUMMARY_FILE - bin/misspell -error -i mosquitto . - lines=$(wc -l < "misspell.log") - if [[ $lines -gt 0 ]]; then - echo "Misspell has findings, fail." - echo "TEST_FAIL=true" >> $GITHUB_ENV - exit 1 - fi \ No newline at end of file