0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

chore!: update scripts

This commit is contained in:
Gao Sun 2022-10-16 00:49:16 +08:00
parent 5dda0a6dd0
commit c96495ad4e
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
6 changed files with 24 additions and 33 deletions

View file

@ -19,18 +19,11 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v1.2.3
uses: silverhand-io/actions-node-pnpm-run-steps@v2
- name: Build
run: pnpm -- lerna run build --stream
- name: Add the mock connectors for integration tests only
run: |
pnpm add-connector @logto/connector-mock-sms
pnpm add-connector @logto/connector-mock-email
pnpm add-connector @logto/connector-mock-social
working-directory: packages/core
- name: Package
run: ./package.sh
@ -60,15 +53,14 @@ jobs:
cp tests/package.json ./
- name: Setup Node and pnpm
uses: silverhand-io/actions-node-pnpm-run-steps@v1.2.3
uses: silverhand-io/actions-node-pnpm-run-steps@v2
with:
run-install: false
# Setup integration test
- name: Install dependencies
run: |
mv tests /tmp/tests
cd /tmp/tests
cd tests
pnpm i
pnpm prepack
@ -81,17 +73,18 @@ jobs:
name: integration-test-${{ github.sha }}
- name: Extract
run: tar -xzf logto.tar.gz
working-directory: tests
run: |
npm run cli init -- -p ../logto --db postgres://postgres:postgres@localhost:5432 --no-oc --du ../logto.tar.gz
- name: Seed database
working-directory: logto/packages/core
run: npm run cli db seed
env:
DB_URL: postgres://postgres:postgres@localhost:5432
- name: Add mock connectors
working-directory: tests
run: |
npm run cli connector add @logto/connector-mock-sms @logto/connector-mock-email @logto/connector-mock-social -- -p ../logto
- name: Run Logto
working-directory: logto/packages/core
run: node . --from-root --all-yes &
run: node . &
env:
INTEGRATION_TEST: true
NODE_ENV: production
@ -103,7 +96,7 @@ jobs:
# Test
- name: Run tests
run: |
cd /tmp/tests/packages/integration-tests
cd tests/packages/integration-tests
pnpm start
env:
INTEGRATION_TESTS_LOGTO_URL: http://localhost:3001

View file

@ -8,8 +8,8 @@ tasks:
pnpm prepack
cd packages/core
pnpm build
pnpm add-official-connectors
cd -
pnpm cli connector add --official
command: |
export ENDPOINT=$(gp url 3001)
pnpm cli db seed

View file

@ -14,9 +14,8 @@ RUN pnpm i
RUN pnpm -- lerna run build --stream
# Add official connectors
WORKDIR /etc/logto/packages/core
RUN pnpm add-official-connectors
WORKDIR /etc/logto
RUN pnpm cli connector add --official
# Prune dependencies for production
RUN rm -rf node_modules packages/*/node_modules
@ -30,5 +29,4 @@ FROM node:16-alpine as app
WORKDIR /etc/logto
COPY --from=builder /etc/logto .
EXPOSE 3001
ENV NO_INQUIRY true
ENTRYPOINT ["npm", "start"]

View file

@ -10,11 +10,9 @@
"prepare": "if test \"$NODE_ENV\" != \"production\" && test \"$CI\" != \"true\" ; then husky install ; fi",
"prepack": "lerna run --stream prepack",
"dev": "lerna run --stream prepack -- --incremental && lerna --ignore=@logto/integration-tests run --parallel dev",
"start": "cd packages/core && NODE_ENV=production node . --from-root",
"//": "For production, use NPM instead",
"cli": "cd packages/core && npm run cli",
"//": "For production, use NPM instead",
"alteration": "cd packages/core && npm run alteration",
"start": "cd packages/core && NODE_ENV=production node .",
"cli": "logto",
"alteration": "logto db alt",
"ci:build": "lerna run --stream build",
"ci:lint": "lerna run --parallel lint",
"ci:stylelint": "lerna run --parallel stylelint",
@ -52,5 +50,8 @@
"jest": "^29.1.2"
}
}
},
"dependencies": {
"@logto/cli": "^1.0.0-beta.10"
}
}

View file

@ -14,10 +14,6 @@
"lint:report": "pnpm lint --format json --output-file report.json",
"dev": "rm -rf build/ && pnpm run copyfiles && nodemon",
"start": "NODE_ENV=production node build/index.js",
"add-connector": "logto connector add -p ../../",
"add-official-connectors": "logto connector add -o -p ../../",
"alteration": "logto db alt",
"cli": "logto",
"test": "jest",
"test:ci": "jest --coverage --silent",
"test:report": "codecov -F core"

View file

@ -7,9 +7,12 @@ importers:
'@commitlint/cli': ^17.0.0
'@commitlint/config-conventional': ^17.0.0
'@commitlint/types': ^17.0.0
'@logto/cli': ^1.0.0-beta.10
husky: ^8.0.0
lerna: ^5.0.0
typescript: ^4.7.4
dependencies:
'@logto/cli': link:packages/cli
devDependencies:
'@commitlint/cli': 17.0.0
'@commitlint/config-conventional': 17.0.0