mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
62 lines
2.1 KiB
YAML
62 lines
2.1 KiB
YAML
name: Tests
|
|
on:
|
|
push:
|
|
pull_request:
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
jobs:
|
|
tests:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install node.js v16
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 16
|
|
|
|
- name: Install dependencies
|
|
uses: ./packages/actions/src/yarnCache
|
|
|
|
- name: Build dependencies (PR)
|
|
if: ${{ github.event_name != 'push' }}
|
|
run: yarn build --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]"
|
|
|
|
- name: Build dependencies (Push)
|
|
if: ${{ github.event_name == 'push' }}
|
|
run: yarn build --filter="...[HEAD^1]"
|
|
|
|
- name: ESLint (PR)
|
|
if: ${{ github.event_name != 'push' }}
|
|
run: yarn lint --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]" -- --format=compact
|
|
|
|
- name: ESLint (Push)
|
|
if: ${{ github.event_name == 'push' }}
|
|
run: yarn lint --filter="...[HEAD^1]" -- --format=compact
|
|
|
|
- name: Tests (PR)
|
|
if: ${{ github.event_name != 'push' }}
|
|
run: yarn test --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]"
|
|
|
|
- name: Tests (Push)
|
|
if: ${{ github.event_name == 'push' }}
|
|
run: yarn test --filter="...[HEAD^1]"
|
|
|
|
- name: Docs (PR)
|
|
if: ${{ github.event_name != 'push' }}
|
|
run: yarn docs --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]"
|
|
|
|
- name: Docs (Push)
|
|
if: ${{ github.event_name == 'push' }}
|
|
run: yarn docs --filter="...[HEAD^1]"
|
|
|
|
- name: Upload Coverage
|
|
if: github.repository_owner == 'discordjs'
|
|
uses: ./packages/actions/src/uploadCoverage
|