build: only run scripts on changed content

This commit is contained in:
iCrawl
2022-11-25 18:44:28 +01:00
parent ec37f137fd
commit 8f5b167483
4 changed files with 38 additions and 10 deletions

View File

@@ -24,17 +24,37 @@ jobs:
- name: Install dependencies
uses: ./packages/actions/src/yarnCache
- name: Build dependencies
run: yarn build
- 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: ESLint
run: yarn lint -- --format=compact
- name: Build dependencies (Push)
if: ${{ github.event_name == 'push' }}
run: yarn test -- --filter="...[HEAD^1]"
- name: Tests
run: yarn test
- name: ESLint (PR)
if: ${{ github.event_name != 'push' }}
run: yarn lint -- --format=compact --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]"
- name: Docs
run: yarn docs
- name: ESLint (Push)
if: ${{ github.event_name == 'push' }}
run: yarn lint -- --format=compact --filter="...[HEAD^1]"
- 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'