diff --git a/.gitea/workflows/README.md b/.gitea/workflows/README.md new file mode 100644 index 0000000..adc5379 --- /dev/null +++ b/.gitea/workflows/README.md @@ -0,0 +1 @@ +Workflows to be compliant with CI/CD pipelines \ No newline at end of file diff --git a/.gitea/workflows/node-ci.yaml b/.gitea/workflows/node-ci.yaml new file mode 100644 index 0000000..86570f9 --- /dev/null +++ b/.gitea/workflows/node-ci.yaml @@ -0,0 +1,49 @@ +name: Node-CI + + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-24.04 + steps: + - name: Gitea Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup Node.js + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version: '22' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Run linter + run: npm run lint + + - name: Run tests + run: npm test + + alert_on_failure: + needs: test + runs-on: ubuntu-24.04 + #if: ${{ needs.test.result == 'failure' }} + steps: + - name: Notify Google Chat + if: ${{ always() }} # Use always to ensure that the notification is also send on failure of former steps + uses: SimonScholz/google-chat-action@3b3519e5102dba8aa5046fd711c4b553586409bb # v1.1.0 + with: + webhookUrl: '${{ secrets.GOOGLE_CHAT_WEBHOOK }}' + jobStatus: ${{ job.status }} + title: Google Chat GitHub Action + subtitle: ${{ job.status }} + createDefaultSection: false + collapsibleDefaultSection: false \ No newline at end of file