Skip to content

Commit

Permalink
refactor: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tung-Huynh-Shopmacher committed Aug 8, 2024
1 parent d98d971 commit 28c56f1
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 83 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Audit

on:
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
audit:
runs-on: ubuntu-latest

defaults:
run:
working-directory: processor

steps:
- name: Run npm audit
run: npm audit

- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

- name: SonarQube Quality Gate
uses: sonarsource/sonarqube-quality-gate-action@master
timeout-minutes: 5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
push:
branches:
- main
- develop
pull_request:
branches:
- '**'

jobs:
build-processor:
runs-on: ubuntu-latest

defaults:
run:
working-directory: processor

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.9.0'

- name: Install dependencies
run: npm ci

- name: Run ESLint check
run: npm run lint

- name: Run Prettier check
run: npm run prettier:check

- name: Build project
run: npm run build

- name: Run tests
run: npm run test
82 changes: 0 additions & 82 deletions .github/workflows/ci.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/testrail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: TestRail

on:
workflow_run:
workflows: ["Build"]
types:
- completed

jobs:
testrail:
runs-on: ubuntu-latest

defaults:
run:
working-directory: processor

steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Upload Test Results to TestRail
env:
TR_INSTANCE: ${{ secrets.TR_INSTANCE }}
TR_PROJECT_NAME: ${{ secrets.TR_PROJECT_NAME }}
TR_USER_EMAIL: ${{ secrets.TR_USER_EMAIL }}
TR_PASSWORD: ${{ secrets.TR_PASSWORD }}
run: |
pip install trcli
trcli -y \
-h "https://$TR_INSTANCE.testrail.io" \
--project "$TR_PROJECT_NAME" \
-u $TR_USER_EMAIL \
-p $TR_PASSWORD \
parse_junit \
--title "Automated Tests - ${{ github.sha }}" \
--run-description ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \
-f "junit-report.xml"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![GitHub Actions](https://github.com/mollie/commercetools-connector/actions/workflows/ci.yml/badge.svg)](https://github.com/mollie/commercetools-connector/actions/workflows/ci.yml/badge.svg)
[![GitHub Actions](https://github.com/mollie/commercetools-connector/actions/workflows/build.yml/badge.svg)](https://github.com/mollie/commercetools-connector/actions/workflows/ci.yml/badge.svg)
[![GitHub Actions](https://github.com/mollie/commercetools-connector/actions/workflows/audit.yml/badge.svg)](https://github.com/mollie/commercetools-connector/actions/workflows/ci.yml/badge.svg)

# 🚀 COMMERCETOOLS MOLLIE CONNECTOR 🚀

Expand Down

0 comments on commit 28c56f1

Please sign in to comment.