Publish #22
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: Controller CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'src/controller/**' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'src/controller/**' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
container: | |
image: node:18 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Remove package.json root | |
run: rm package.json package-lock.json | |
working-directory: ./ | |
- name: Install Dependencies | |
run: npm install | |
working-directory: ./src/controller | |
- name: Run Build | |
run: npm run build | |
working-directory: ./src/controller | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts | |
path: ./src/controller | |
testunit: | |
name: Test Unit | |
runs-on: ubuntu-latest | |
needs: build | |
container: | |
image: node:18 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Remove package.json root | |
run: rm package.json package-lock.json | |
working-directory: ./ | |
- name: Reuse Built Files | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
path: ./src/controller | |
- name: Adjust permissions | |
run: chmod -R 777 ./src/controller | |
- name: Run Unit Tests | |
run: npm run test-ci-unit | |
working-directory: ./src/controller | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-artifacts | |
path: ./src/controller | |
codecov: | |
name: Codecov | |
runs-on: ubuntu-latest | |
needs: testunit | |
container: | |
image: node:18 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Reuse Built Files | |
uses: actions/download-artifact@v4 | |
with: | |
name: test-artifacts | |
path: ./src/controller | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: ./src/controller/coverage/coverage-final.json | |
flags: controller | |
name: controller | |
fail_ci_if_error: true | |
verbose: true | |