From c61897fabb40e458987bef0b35704da5c4e6bb3b Mon Sep 17 00:00:00 2001 From: Samir Kamal <1954121+skamril@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:05:40 +0200 Subject: [PATCH] test --- .github/workflows/commitlint.yml | 9 +++++--- .github/workflows/deploy.yml | 3 +-- .github/workflows/main.yml | 39 ++++++++++++++++++++++---------- .github/workflows/worker.yml | 2 +- 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 89b899c5a3..7545e0107d 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -1,4 +1,5 @@ -name: Lint Commit Messages +name: commitlint + on: [pull_request] permissions: @@ -9,5 +10,7 @@ jobs: commitlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: wagoid/commitlint-github-action@v5 + - name: Checkout GitHub repo + uses: actions/checkout@v4 + - name: Lint Commit Messages + uses: wagoid/commitlint-github-action@v5 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e91a2a0b65..c662f2ff6b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,9 @@ name: deploy + on: push: branches: - "master" - - "hotfix/**" jobs: binary: @@ -12,7 +12,6 @@ jobs: max-parallel: 3 matrix: os: [ windows-latest, ubuntu-20.04, ubuntu-22.04] - steps: - name: 🐙 Checkout GitHub repo (+ download lfs dependencies) uses: actions/checkout@v4 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b1038ddcd..8a8205f6f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,14 +1,21 @@ name: main -on: - push: - branches: - - "**" + +# If a workflow is skipped due to path filtering, branch filtering or a commit message, +# then checks associated with that workflow will remain in a "Pending" state. +# A pull request that requires those checks to be successful will be blocked from merging. +# So we use conditions to control job execution (`if: ...`) instead of `pull_request` event parameters. +on: [pull_request] jobs: + + ################################################################ + ## Python + ################################################################ + python-lint: runs-on: ubuntu-20.04 steps: - - name: Checkout github repo (+ download lfs dependencies) + - name: Checkout GitHub repo (+ download lfs dependencies) uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 @@ -39,9 +46,8 @@ jobs: max-parallel: 9 matrix: os: [windows-latest, ubuntu-20.04] - steps: - - name: Checkout github repo (+ download lfs dependencies) + - name: Checkout GitHub repo (+ download lfs dependencies) uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 @@ -64,11 +70,15 @@ jobs: with: name: python-code-coverage-report path: coverage.xml + + ################################################################ + ## npm + ################################################################ npm-setup: runs-on: ubuntu-20.04 steps: - - name: Checkout github repo + - name: Checkout GitHub repo uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 @@ -88,10 +98,11 @@ jobs: working-directory: webapp npm-lint: + if: ${{ contains(github.event.pull_request.files.*.filename, 'webapp/') }} needs: npm-setup runs-on: ubuntu-20.04 steps: - - name: Checkout github repo + - name: Checkout GitHub repo uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 @@ -111,7 +122,7 @@ jobs: needs: npm-setup runs-on: ubuntu-20.04 steps: - - name: Checkout github repo + - name: Checkout GitHub repo uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 @@ -131,7 +142,7 @@ jobs: needs: npm-setup runs-on: ubuntu-20.04 steps: - - name: Checkout github repo + - name: Checkout GitHub repo uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 @@ -150,6 +161,10 @@ jobs: NODE_OPTIONS: --max-old-space-size=8192 DISABLE_ESLINT_PLUGIN: true + ################################################################ + ## SonarCloud + ################################################################ + sonarcloud: runs-on: ubuntu-20.04 needs: [python-test, npm-test] @@ -163,4 +178,4 @@ jobs: uses: sonarsource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.github/workflows/worker.yml b/.github/workflows/worker.yml index 4839670d62..50ae7f89f6 100644 --- a/.github/workflows/worker.yml +++ b/.github/workflows/worker.yml @@ -1,4 +1,5 @@ name: worker + on: push: branches: @@ -8,7 +9,6 @@ on: jobs: binary: runs-on: windows-latest - steps: - name: 🐙 Checkout GitHub repo (+ download lfs dependencies) uses: actions/checkout@v4