Skip to content

kk

kk #193

Workflow file for this run

name: Test/Build CI
on:
push:
branches:
- main
- 2.x.x-release
pull_request:
release:
types: [ published ]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
danger:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install danger
run: npm ci
- name: Run danger and create github comment if necessary
run: npm run danger ci
lint:
runs-on: ubuntu-latest
needs: danger
strategy:
matrix:
node-version: [ 18.x ]
project: [ frontend, api, blockchain, provisioning ]
defaults:
run:
working-directory: ${{ matrix.project }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/lint
audit:
runs-on: ubuntu-latest
needs: [ danger, lint ]
strategy:
matrix:
node-version: [ 18.x ]
project:
[
frontend,
api,
blockchain,
provisioning,
e2e-test,
excel-export-service,
email-notification-service,
storage-service,
logging-service,
migration
]
defaults:
run:
working-directory: ${{ matrix.project }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: ./.github/workflows/audit
test:
runs-on: ubuntu-latest
needs: [ danger, lint, audit ]
strategy:
matrix:
node-version: [ 18.x ]
project: [ frontend, api ]
defaults:
run:
working-directory: ${{ matrix.project }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci --legacy-peer-deps
- name: Check for Changes in ${{ matrix.project }}
uses: marceloprado/has-changed-path@v1
id: run-test
with:
paths: ${{ matrix.project }}
- name: Test
if: steps.run-test.outputs.changed == 'true'
uses: ./.github/workflows/test
build:
runs-on: ubuntu-latest
needs: [ danger, lint, audit, test ]
strategy:
matrix:
project:
[
frontend,
api,
blockchain,
provisioning,
e2e-test,
excel-export-service,
email-notification-service,
storage-service,
logging-service,
migration
]
include:
- project: frontend
image_name: trubudget/frontend
- project: api
image_name: trubudget/api
- project: blockchain
image_name: trubudget/blockchain
- project: provisioning
image_name: trubudget/provisioning
- project: e2e-test
image_name: trubudget/e2e-test
- project: excel-export-service
image_name: trubudget/excel-export
- project: email-notification-service
image_name: trubudget/email-notification
- project: storage-service
image_name: trubudget/storage-service
- project: logging-service
image_name: trubudget/logging-service
- project: migration
image_name: trubudget/migration
defaults:
run:
working-directory: ${{ matrix.project }}
env:
GITHUB_PR_NUMBER: ${{ github.event.number}}
GITHUB_BASE_REF: ${{ github.base_ref}}
GITHUB_HEAD_REF: ${{ github.head_ref}}
PRIVATE_REGISTRY: ${{ secrets.PRIVATE_REGISTRY}}
PRIVATE_REGISTRY_BASE: ${{ secrets.PRIVATE_REGISTRY_BASE}}
PRIVATE_REGISTRY_USERNAME: ${{ secrets.PRIVATE_REGISTRY_USERNAME}}
PRIVATE_REGISTRY_PASSWORD: ${{ secrets.PRIVATE_REGISTRY_PASSWORD}}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD}}
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME}}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD}}
IMAGE_NAME: ${{ matrix.image_name}}
steps:
- uses: actions/checkout@v2
- uses: docker-practice/actions-setup-docker@master
- uses: ./.github/workflows/build
notification:
runs-on: ubuntu-latest
needs: [ lint, test, danger, audit, build ]
env:
GITHUB_BASE_REF: ${{ github.base_ref}}
GITHUB_HEAD_REF: ${{ github.head_ref}}
GITHUB_PR_NUMBER: ${{ github.event.number}}
WEBHOOK_TOKEN: ${{ secrets.WEBHOOK_TOKEN }}
WEBHOOK_REF: ${{ secrets.WEBHOOK_REF_2 }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/notification