chore: cleaning up github actions workflow #2
This file contains 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: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test-unit: | |
runs-on: ubuntu-latest | |
# needs: build | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'pnpm' | |
- name : install dependencies | |
run: make install | |
- name : build | |
run: make build | |
- name : test | |
run: make test-unit | |
- name: cleanup | |
run: sudo chown -R $(whoami):$(id -ng) . | |
- name: upload coverage from unit tests | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-from-unit-tests | |
path: | | |
**/coverage/lcov.info | |
**/coverage/coverage-final.json | |
retention-days: 1 | |
test-features: | |
runs-on: ubuntu-latest | |
# needs: build | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'pnpm' | |
- name : install dependencies | |
run: make install | |
- name : build | |
run: make build | |
- name : test | |
run: make test-features | |
- name: cleanup | |
run: sudo chown -R $(whoami):$(id -ng) . | |
- name: upload coverage from features tests | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-from-features-tests | |
path: | | |
**/coverage/features-it/lcov.info | |
**/coverage/features-it/coverage-final.json | |
**/coverage/features-it-api/lcov.info | |
**/coverage/features-it-api/coverage-final.json | |
**/coverage/features-core-domain/lcov.info | |
**/coverage/features-core-domain/coverage-final.json | |
retention-days: 1 | |
test-smoke: | |
runs-on: ubuntu-latest | |
# needs: build | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'pnpm' | |
- name : install dependencies | |
run: make install | |
- name : build | |
run: make build | |
- name : test | |
run: make test-smoke | |
- name: cleanup | |
run: sudo chown -R $(whoami):$(id -ng) . | |
- name: upload coverage from features tests | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-from-smoke-tests | |
path: | | |
**/coverage/smoke/lcov.info | |
**/coverage/smoke/coverage-final.json | |
retention-days: 1 | |
lint: | |
runs-on: ubuntu-latest | |
needs: | |
- test-unit | |
- test-features | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'pnpm' | |
- name : install dependencies | |
run: make install-offline | |
- name : build | |
run: make build | |
- name : lint | |
run: make lint | |
coverage: | |
runs-on: ubuntu-latest | |
needs: | |
- test-unit | |
- test-features | |
- test-smoke | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- name: download coverage from unit tests | |
uses: actions/download-artifact@v3 | |
id: download-coverage-from-unit-tests | |
with: | |
name: coverage-from-unit-tests | |
continue-on-error: true | |
- name: download coverage from features tests | |
uses: actions/download-artifact@v3 | |
id: download-coverage-from-features-tests | |
with: | |
name: coverage-from-features-tests | |
continue-on-error: true | |
- name: download coverage from smoke tests | |
uses: actions/download-artifact@v3 | |
id: download-coverage-from-smoke-tests | |
with: | |
name: coverage-from-smoke-tests | |
continue-on-error: true | |
- name: install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'pnpm' | |
- name : install dependencies | |
run: make install-offline | |
# - name: codecov | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
# files: ./coverage/lcov.info # optional | |
# flags: unittests # optional | |
# name: codecov-umbrella # optional | |
# fail_ci_if_error: true # optional (default = false) | |
# verbose: false # optional (default = false) | |
# - uses: SonarSource/sonarcloud-github-action@v2.0.0 | |
# env: | |
# SONAR_TOKEN: ${{ env.SONAR_TOKEN }} | |