name: CI on: push: branches: [ main ] pull_request: branches: [ main ] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: persist-credentials: false # minimize exposure and prevent accidental pushes - name: Use Node.js 16 uses: actions/setup-node@v3 with: node-version: '16' cache: yarn - name: Install dependencies run: yarn --immutable env: YARN_ENABLE_SCRIPTS: 0 # disable postinstall scripts - name: Lint code run: yarn test:lint - name: Run Flow run: yarn test:flow if: always() - name: Run Jest tests run: yarn test:jest --coverage if: always() - name: Build run: yarn build - uses: codecov/codecov-action@v3 with: directory: ./coverage/ timeout-minutes: 3 release: runs-on: ubuntu-latest if: github.event_name == 'push' environment: release needs: test steps: - uses: actions/checkout@v3 with: persist-credentials: false fetch-depth: 0 - name: Use Node.js 16 uses: actions/setup-node@v3 with: node-version: '16' cache: yarn - name: Install dependencies run: yarn --immutable env: YARN_ENABLE_SCRIPTS: 0 # disable postinstall scripts - name: Run semantic-release run: yarn run semantic-release --debug env: GH_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GIT_AUTHOR_NAME: KaTeX bot GIT_AUTHOR_EMAIL: 33710906+KaTeX-bot@users.noreply.github.com GIT_COMMITTER_NAME: KaTeX bot GIT_COMMITTER_EMAIL: 33710906+KaTeX-bot@users.noreply.github.com