mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
ci: only test run affected packages
This commit is contained in:
13
.github/check_deploy_branch.sh
vendored
13
.github/check_deploy_branch.sh
vendored
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
git diff HEAD^ HEAD --quiet .
|
|
||||||
|
|
||||||
if [[ "$VERCEL_GIT_COMMIT_REF" == "main" || $? -eq 1 ]]; then
|
|
||||||
# Proceed with the build
|
|
||||||
echo "✅ - Proceed"
|
|
||||||
exit 1;
|
|
||||||
else
|
|
||||||
# Don't build
|
|
||||||
echo "🛑 - Build cancelled"
|
|
||||||
exit 0;
|
|
||||||
fi
|
|
||||||
38
.github/workflows/tests.yml
vendored
38
.github/workflows/tests.yml
vendored
@@ -1,8 +1,38 @@
|
|||||||
name: Tests
|
name: Tests
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
|
detect-changes:
|
||||||
|
name: Detect changes
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
packages: ${{ steps.filter.outputs.changes }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: dorny/paths-filter@v2
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
'@discordjs/actions': 'packages/actions'
|
||||||
|
'@discordjs/builders': 'packages/builders'
|
||||||
|
'@discordjs/collection': 'packages/collection'
|
||||||
|
'discord.js': 'packages/discord.js'
|
||||||
|
'@discordjs/docgen': 'packages/docgen'
|
||||||
|
'@discordjs/proxy': 'packages/proxy'
|
||||||
|
'@discordjs/proxy-container': 'packages/proxy-container'
|
||||||
|
'@discordjs/rest': 'packages/rest'
|
||||||
|
'@discordjs/scripts': 'packages/scripts'
|
||||||
|
'@discordjs/voice': 'packages/voice'
|
||||||
|
'@discordjs/website': 'packages/website'
|
||||||
|
'@discordjs/ws': 'packages/ws'
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
name: Tests
|
name: Tests
|
||||||
|
needs: changes
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
package: ${{ fromJSON(needs.changes.outputs.packages) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -16,16 +46,16 @@ jobs:
|
|||||||
cache-dependency-path: yarn.lock
|
cache-dependency-path: yarn.lock
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn --immutable
|
run: yarn workspaces focus ${{ matrix.package }}
|
||||||
|
|
||||||
- name: Build dependencies
|
- name: Build dependencies
|
||||||
run: yarn build
|
run: yarn workspace ${{ matrix.package }} build
|
||||||
|
|
||||||
- name: ESLint
|
- name: ESLint
|
||||||
run: yarn lint
|
run: yarn workspace ${{ matrix.package }} lint
|
||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: yarn test
|
run: yarn workspace ${{ matrix.package }} test
|
||||||
|
|
||||||
- name: Upload Coverage
|
- name: Upload Coverage
|
||||||
uses: ./packages/actions/src/uploadCoverage
|
uses: ./packages/actions/src/uploadCoverage
|
||||||
|
|||||||
Reference in New Issue
Block a user