Feature/add weekly financial report schedule (#116) #616
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Code Quality | |
| on: | |
| pull_request: | |
| types: [synchronize, opened, reopened] | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: cd workers/main && npm install | |
| - name: Run ESLint | |
| run: cd workers/main && npm run eslint | |
| sonarqube: | |
| name: SonarQube | |
| runs-on: ubuntu-latest | |
| if: vars.SONAR_DISABLE_CI != 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Install dependencies | |
| run: cd workers/main && npm install | |
| - name: Run tests with coverage | |
| run: cd workers/main && npm run coverage | |
| - name: Run SonarQube scan | |
| uses: SonarSource/sonarqube-scan-action@v6 | |
| with: | |
| args: > | |
| -Dsonar.organization=automatization-bot | |
| -Dsonar.verbose=true | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| hadolint: | |
| name: Dockerfile Linting | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Lint Dockerfile.n8n | |
| run: docker run --rm -i hadolint/hadolint < Dockerfile.n8n | |
| - name: Lint Dockerfile.temporal | |
| run: docker run --rm -i hadolint/hadolint < Dockerfile.temporal | |
| docker-scout: | |
| name: Docker Security Scanning | |
| runs-on: ubuntu-latest | |
| needs: hadolint | |
| continue-on-error: true | |
| strategy: | |
| matrix: | |
| service: | |
| - name: n8n | |
| dockerfile: Dockerfile.n8n | |
| tag: n8n-test:latest | |
| - name: temporal | |
| dockerfile: Dockerfile.temporal | |
| tag: temporal-test:latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build ${{ matrix.service.name }} image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ${{ matrix.service.dockerfile }} | |
| push: false | |
| tags: ${{ matrix.service.tag }} | |
| load: true | |
| - name: Scan ${{ matrix.service.name }} image | |
| uses: docker/scout-action@v1 | |
| id: docker_scout | |
| with: | |
| command: cves | |
| image: ${{ matrix.service.tag }} | |
| sarif-file: ${{ matrix.service.name }}-scan.sarif | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| summary: true | |
| format: json | |
| write-comment: true | |
| only-severities: critical,high | |
| - name: Upload ${{ matrix.service.name }} scan results | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: ${{ matrix.service.name }}-scan.sarif | |
| category: ${{ matrix.service.name }} | |
| service-check: | |
| name: Service Availability Check | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Copy .env file | |
| run: cp .env.example .env | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build services with no cache | |
| run: docker compose build --no-cache | |
| - name: Start services | |
| run: docker compose up -d | |
| - name: Verify services | |
| run: bash scripts/check_services.sh | |
| - name: Stop services | |
| if: always() | |
| run: docker compose down -v |