Merge pull request #15022 from Budibase/fix-ci-on-master

Fix the NX check that looks for only affected packages when running tests in CI
This commit is contained in:
Sam Rose 2024-11-18 14:53:35 +00:00 committed by GitHub
commit 98598addb7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 9 deletions

View File

@ -199,18 +199,22 @@ jobs:
env:
DATASOURCE: ${{ matrix.datasource }}
run: |
AFFECTED=$(yarn --silent nx show projects --affected -t test --base=${{ env.NX_BASE_BRANCH }} -p @budibase/server)
if [ -n "$AFFECTED" ]; then
cd packages/server
if [ "${{ matrix.datasource }}" == "none" ]; then
yarn test --filter ./src/tests/filters/non-datasource-tests.js --passWithNoTests
else
yarn test --filter ./src/tests/filters/datasource-tests.js --passWithNoTests
if ${{ env.ONLY_AFFECTED_TASKS }}; then
AFFECTED=$(yarn --silent nx show projects --affected -t test --base=${{ env.NX_BASE_BRANCH }} -p @budibase/server)
if [ -z "$AFFECTED" ]; then
echo "No affected tests to run"
exit 0
fi
else
echo "No affected tests to run"
fi
FILTER="./src/tests/filters/datasource-tests.js"
if [ "${{ matrix.datasource }}" == "none" ]; then
FILTER="./src/tests/filters/non-datasource-tests.js"
fi
cd packages/server
yarn test --filter $FILTER --passWithNoTests
check-pro-submodule:
runs-on: ubuntu-latest
if: inputs.run_as_oss != true && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase')