Skip to content

Node.js

Node.js #7902

Workflow file for this run

name: Node.js
on:
push:
pull_request:
workflow_dispatch:
merge_group:
env:
MCO_LOG_LEVEL: warn
EXTERNAL_HOST: mcouniverse.com
PRIVATE_KEY_FILE: data/private_key.pem # These secrets are stored in the repository and are safe to "leak"
CERTIFICATE_FILE: data/mcouniverse.crt # These secrets are stored in the repository and are safe to "leak"
PUBLIC_KEY_FILE: data/pub.key # These secrets are stored in the repository and are safe to "leak"
jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
fetch-depth: 0
- name: Use Node.js 20.x
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: 20.x
- name: Setup pnpm
uses: pnpm/action-setup@v4.0.0
- name: Install and test
run: |
pnpm install
make test
env:
CODECOV_UPLOAD_BUNDLE_TOKEN: ${{ secrets.CODECOV_UPLOAD_BUNDLE_TOKEN }}
- name: Codecov install cli
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
pip install --user pytest
pip install --user codecov-cli
- name: Codecov create comit and report
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose create-commit --fail-on-error
codecovcli --verbose create-report --fail-on-error
- name: Codecov upload test results
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli do-upload --report-type test_results --file mcos.junit.xml
- name: Codecov upload cli coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag cli --name cli --dir packages/cli
- name: Codecov upload connection coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag connection --name connection --dir packages/connection
- name: Codecov upload database coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag database --name database --dir packages/database
- name: Codecov upload gateway coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag gateway --name gateway --dir packages/gateway
- name: Codecov upload lobby coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag lobby --name lobby --dir packages/lobby
- name: Codecov upload login coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag login --name login --dir packages/login
- name: Codecov upload mcots coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag mcots --name mcots --dir packages/mcots
- name: Codecov upload nps coverageq
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag nps --name nps --dir packages/nps
- name: Codecov upload patch coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag patch --name patch --dir packages/patch
- name: Codecov upload persona coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag persona --name persona --dir packages/persona
- name: Codecov upload sessions coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag sessions --name sessions --dir packages/sessions
- name: Codecov upload shard coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag shard --name shard --dir packages/shard
- name: Codecov upload shared coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag shared --name shared --dir packages/shared
- name: Codecov upload shared-packets coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag shared-packets --name shared-packets --dir packages/shared-packets
- name: Codecov upload transactions coverage
if: ${{ always() }} # using always() to always run this step because i am uploading test results and coverage in one step
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
codecovcli --verbose do-upload --fail-on-error --flag transactions --name transactions --dir packages/transactions
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: coverage_${{ matrix.node-version }}
path: coverage