Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 60 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,8 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9
with:
commit_message: Update THIRD_PARTY_LICENSES.txt
test:
strategy:
matrix:
test-suits:
- name: UI
include: ui-*,*-ui
- name: Blocks Shard 1
include: blocks-a*,blocks-c*,blocks-d*,
- name: Blocks Shard 2
include: blocks-f*,blocks-g*,blocks-m*,
- name: Blocks Shard 3
include: blocks-*
exclude: blocks-a*,blocks-c*,blocks-d*,blocks-f*,blocks-g*,blocks-m*,
- name: Server API Unit Tests
key: server-api-unit
target: test-unit
include: server-api
- name: Server API Integration Tests
key: server-api-integration
include: server-api
- name: Engine and Libraries
key: others
exclude: ui-*,*-ui,blocks-*,server-api
name: Test ${{ matrix.test-suits.name }}
build:
name: Build Project
needs: install
runs-on: ubuntu-latest
steps:
Expand All @@ -141,25 +119,46 @@ jobs:
uses: actions/[email protected]
with:
path: .nx/cache
key: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}-${{ github.sha }}
restore-keys: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}-
save-always: true
- name: Test
if: steps.nx-test-cache.outputs.cache-hit != 'true'
continue-on-error: false
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08
with:
timeout_minutes: 10
max_attempts: 3
retry_on: error
command: npx nx run-many --target ${{ matrix.test-suits.target || 'test' }} --projects "${{ matrix.test-suits.include }}" --exclude "${{ matrix.test-suits.exclude }}" --quiet
key: nx-build-${{ github.sha }}
restore-keys: nx-build-
- name: Build project
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
- name: Truncate NX cache
run: ./tools/truncate-nx-cache.sh
build:
name: Build Project
needs: install
run: |
npm run prepare
npx nx run-many --target=build
./tools/truncate-nx-cache.sh
- name: Save build cache
uses: actions/cache/[email protected]
with:
path: dist
key: dist-${{ github.sha }}
test:
strategy:
matrix:
test-suits:
- name: UI
include: ui-*,*-ui
- name: Blocks Shard 1
include: blocks-a*,blocks-c*,blocks-d*,
- name: Blocks Shard 2
include: blocks-f*,blocks-g*,blocks-m*,
- name: Blocks Shard 3
include: blocks-*
exclude: blocks-a*,blocks-c*,blocks-d*,blocks-f*,blocks-g*,blocks-m*,
- name: Server API Unit Tests
key: server-api-unit
target: test-unit
include: server-api
- name: Server API Integration Tests
key: server-api-integration
target: test-integration
include: server-api
- name: Engine and Libraries
key: others
exclude: ui-*,*-ui,blocks-*,server-api
name: Test ${{ matrix.test-suits.name }}
needs: [ install, build ]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
Expand All @@ -170,24 +169,32 @@ jobs:
path: node_modules
key: node-modules-cache-${{ hashFiles('package-lock.json', '.npmrc') }}
fail-on-cache-miss: true
- name: Restore build cache
uses: actions/cache/[email protected]
with:
path: dist
key: dist-${{ github.sha }}
fail-on-cache-miss: true
- name: Restore NX cache
uses: actions/[email protected]
with:
path: .nx/cache
key: nx-build-${{ github.sha }}
restore-keys: nx-build-
- name: Build project
key: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}-${{ github.sha }}
restore-keys: nx-test-${{ matrix.test-suits.key || matrix.test-suits.name }}-
save-always: true
- name: Test
if: steps.nx-test-cache.outputs.cache-hit != 'true'
continue-on-error: false
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08
with:
timeout_minutes: 10
max_attempts: 3
retry_on: error
command: npx nx run-many --target ${{ matrix.test-suits.target || 'test' }} --projects "${{ matrix.test-suits.include }}" --exclude "${{ matrix.test-suits.exclude }}" --quiet
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
run: |
npm run prepare
npx nx run-many --target=build
./tools/truncate-nx-cache.sh
- name: Save build cache
uses: actions/cache/[email protected]
with:
path: dist
key: dist-${{ github.sha }}
- name: Truncate NX cache
run: ./tools/truncate-nx-cache.sh
build-images:
strategy:
matrix:
Expand Down
14 changes: 12 additions & 2 deletions packages/server/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,28 @@
"testPathPattern": ["packages/server/api/test/integration/cloud"]
}
},
"test": {
"test-integration": {
"executor": "nx:run-commands",
"options": {
"commands": [
"nx run-many -t build -p server*,blocks-*,openops*,shared",
"./tools/link-packages.sh",
"export $(cat packages/server/api/.env.tests | xargs) && OPS_EDITION=cloud nx test-cloud server-api --output-style stream-without-prefixes",
"export $(cat packages/server/api/.env.tests | xargs) && OPS_EDITION=ce nx test-ce server-api --output-style stream-without-prefixes"
],
"parallel": false
}
},
"test": {
"executor": "nx:run-commands",
"options": {
"commands": [
"nx run-many -t build -p server*,blocks-*,openops*,shared",
"nx test-unit server-api",
"nx test-integration server-api"
],
"parallel": false
}
},
"test:docker": {
"command": "UID=\"$(id -u)\" GID=\"$(id -g)\" docker compose --profile full -f docker-compose.test.yml up --exit-code-from app --attach app"
},
Expand Down
Loading