Merge pull request #596 from dzcode-io/cleanup-repo-sec-issues #103
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 Check for main Branch" | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
install-build-lint-test-coverage-misc: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: [20.x] | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
fail-fast: false | |
steps: | |
- name: "Git" | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: "Nodejs" | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
- name: "Install" | |
shell: bash | |
run: | | |
npm ci | |
- name: "Build" | |
shell: bash | |
run: | | |
npm run build | |
- name: "Lint" | |
shell: bash | |
run: | | |
npm run lint:alone | |
- name: "Test" | |
shell: bash | |
run: | | |
npm run test:alone -- -- --coverage | |
- uses: codecov/codecov-action@v4 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
flags: api | |
name: codecov-api | |
directory: ./api | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- uses: codecov/codecov-action@v4 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
flags: web | |
name: codecov-web | |
directory: ./web | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- uses: codecov/codecov-action@v4 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
flags: data | |
name: codecov-data | |
directory: ./data | |
fail_ci_if_error: false # put it back to true once we have tests in ./data | |
- uses: codecov/codecov-action@v4 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
flags: models | |
name: codecov-models | |
directory: ./packages/models | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- uses: codecov/codecov-action@v4 | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
with: | |
flags: utils | |
name: codecov-utils | |
directory: ./packages/utils | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: "Misc" | |
shell: bash | |
run: | | |
npx lerna run bundle:alone --scope @dzcode.io/web | |
npx lerna run generate:sitemap --scope @dzcode.io/web | |
npx lerna run generate:htmls --scope @dzcode.io/web | |
env: | |
CI: true |