From fb5d3b1d3b1b718cf68998637d0578bc3ba269ec Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 20 Nov 2023 15:11:07 +0100 Subject: [PATCH] workflow: test:lint code --- .github/file-filters.yml | 4 ++++ .github/webhooks/test.lint.code.yml | 34 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/file-filters.yml create mode 100644 .github/webhooks/test.lint.code.yml diff --git a/.github/file-filters.yml b/.github/file-filters.yml new file mode 100644 index 0000000..4562c0b --- /dev/null +++ b/.github/file-filters.yml @@ -0,0 +1,4 @@ +# These file filter patterns are used by the action https://github.com/dorny/paths-filter + +frontend: &frontend + - '**/*' \ No newline at end of file diff --git a/.github/webhooks/test.lint.code.yml b/.github/webhooks/test.lint.code.yml new file mode 100644 index 0000000..62a871e --- /dev/null +++ b/.github/webhooks/test.lint.code.yml @@ -0,0 +1,34 @@ +name: "test:lint code with defined linters" + +on: push + +jobs: + # only (but most important) job from this workflow required for pull requests + # check results serve as run conditions for all other jobs here + files-changed: + name: Detect File Changes - Frontend + runs-on: ubuntu-latest + outputs: + frontend: ${{ steps.changes.outputs.frontend }} + steps: + - uses: actions/checkout@v3.3.0 + + - name: Check for frontend file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + + lint: + if: needs.files-changed.outputs.frontend == 'true' + name: Lint - Frontend + needs: files-changed + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Frontend | Lint + run: npm install && npm run test:lint \ No newline at end of file