mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor(test): refactor integration-test workflow to link mock connectors (#1720)
* refactor(test): another way to link mock connectors in integration tests * refactor(test): extract link-mock-connectors.sh * refactor(test): remove unused env variable in integration-test.yml
This commit is contained in:
parent
a62793a3f0
commit
ff151b2010
3 changed files with 15 additions and 14 deletions
6
.github/workflows/integration-test.yml
vendored
6
.github/workflows/integration-test.yml
vendored
|
@ -22,9 +22,9 @@ jobs:
|
|||
uses: silverhand-io/actions-node-pnpm-run-steps@v1.2.3
|
||||
|
||||
- name: Package
|
||||
run: ./package.sh
|
||||
env:
|
||||
INTEGRATION_TEST: true
|
||||
run: |
|
||||
./link-mock-connectors.sh
|
||||
./package.sh
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
|
11
link-mock-connectors.sh
Executable file
11
link-mock-connectors.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
set -eo pipefail
|
||||
|
||||
echo Link the mock connectors for integration tests only
|
||||
cd packages/core
|
||||
pnpm link @logto/connector-mock-sms
|
||||
pnpm link @logto/connector-mock-email
|
||||
pnpm link @logto/connector-mock-social
|
||||
cd -
|
||||
|
||||
echo Update the pnpm-lock.json
|
||||
pnpm i --no-frozen-lockfile --lockfile-only
|
12
package.sh
12
package.sh
|
@ -7,17 +7,7 @@ echo Prune dependencies
|
|||
rm -rf node_modules packages/*/node_modules
|
||||
|
||||
echo Install production dependencies
|
||||
if [[ $INTEGRATION_TEST =~ ^(true|1)$ ]]; then
|
||||
echo Install the mock connectors for integration tests only
|
||||
cd packages/core
|
||||
pnpm link @logto/connector-mock-sms
|
||||
pnpm link @logto/connector-mock-email
|
||||
pnpm link @logto/connector-mock-social
|
||||
cd -
|
||||
NODE_ENV=production pnpm i --no-frozen-lockfile
|
||||
else
|
||||
NODE_ENV=production pnpm i
|
||||
fi
|
||||
NODE_ENV=production pnpm i
|
||||
|
||||
echo Prune files
|
||||
rm -rf \
|
||||
|
|
Loading…
Reference in a new issue