Skip to content

Commit

Permalink
chore: using centralized github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
newlight77 committed Feb 2, 2024
1 parent 9431d66 commit e8fc0f2
Showing 1 changed file with 12 additions and 192 deletions.
204 changes: 12 additions & 192 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,195 +7,15 @@ on:
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 }}

ci:
uses: newlight77/github-actions/.github/workflows/node-ci.yml@main
secrets:
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
sonar-token: ${{ secrets.SONAR_TOKEN }}
codecov-token: ${{ secrets.CODECOV_TOKEN }}
with:
with-unit-test: true
with-feature-test: true
with-lint: true
coverage-tool: 'codecov, sonar'
slack-room-id: 'C05UA1LUW1H'

0 comments on commit e8fc0f2

Please sign in to comment.