Skip to content

WIP: Autogenerate types from official documentation #210

WIP: Autogenerate types from official documentation

WIP: Autogenerate types from official documentation #210

Workflow file for this run

# This workflow is designed to check if the Node.js package can be built,
# the format and lint rules are respected, documentation can be generated
# and if the tests don't throw errors.
name: Node.js CI
# When a commit on the main or dev branch is created or a pull request
# is created run this workflow
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main ]
# This attribute allows to manually trigger the workflow from the
# Actions tab from the GitHub website
workflow_dispatch:
jobs:
# The build job tries to build the package and the documentation,
# checks if the formatting and linting rules are respected and checks
# if all tests can be run without throwing errors
build:
strategy:
matrix:
node-version: [19.x]
os: [ubuntu-latest,windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
# Run tests but keep in mind that not all pull requests have access
# to workflow secrets
- run: npm run test:no-refresh-token
if: github.event_name != 'pull_request'
env:
OSU_OAUTH_CLIENT_ID: ${{ secrets.OSU_OAUTH_CLIENT_ID }}
OSU_OAUTH_CLIENT_SECRET: ${{ secrets.OSU_OAUTH_CLIENT_SECRET }}
# > If this workflow was triggered by a pull request only check for
# tests that don't require workflow secrets and run but ignore the
# tests that require them
- run: npm run test:no-osu-api-v2
if: github.event_name == 'pull_request'
- run: npm run test:no-refresh-token
if: github.event_name == 'pull_request'
continue-on-error: true
# Creating the documentation requires additional dependencies
- name: Install documentation dependencies (apt - ubuntu-latest)
if: matrix.os == 'ubuntu-latest'
run: sudo apt install graphviz
- name: Install documentation dependencies (choco - windows-latest)
if: matrix.os == 'windows-latest'
run: choco install graphviz
# Generate pages that can be included into the documentation
- run: npm run docs:createPagesExampleOutput
- run: npm run docs
# Linting
- run: npm run lint
- run: npm run lint:circular
continue-on-error: true
- run: npm run lint:exports
continue-on-error: true