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:
parent
5dda0a6dd0
commit
c96495ad4e
6 changed files with 24 additions and 33 deletions
31
.github/workflows/integration-test.yml
vendored
31
.github/workflows/integration-test.yml
vendored
|
@ -19,18 +19,11 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup Node and pnpm
|
- 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
|
- name: Build
|
||||||
run: pnpm -- lerna run build --stream
|
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
|
- name: Package
|
||||||
run: ./package.sh
|
run: ./package.sh
|
||||||
|
|
||||||
|
@ -60,15 +53,14 @@ jobs:
|
||||||
cp tests/package.json ./
|
cp tests/package.json ./
|
||||||
|
|
||||||
- name: Setup Node and pnpm
|
- 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:
|
with:
|
||||||
run-install: false
|
run-install: false
|
||||||
|
|
||||||
# Setup integration test
|
# Setup integration test
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
mv tests /tmp/tests
|
cd tests
|
||||||
cd /tmp/tests
|
|
||||||
pnpm i
|
pnpm i
|
||||||
pnpm prepack
|
pnpm prepack
|
||||||
|
|
||||||
|
@ -81,17 +73,18 @@ jobs:
|
||||||
name: integration-test-${{ github.sha }}
|
name: integration-test-${{ github.sha }}
|
||||||
|
|
||||||
- name: Extract
|
- 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
|
- name: Add mock connectors
|
||||||
working-directory: logto/packages/core
|
working-directory: tests
|
||||||
run: npm run cli db seed
|
run: |
|
||||||
env:
|
npm run cli connector add @logto/connector-mock-sms @logto/connector-mock-email @logto/connector-mock-social -- -p ../logto
|
||||||
DB_URL: postgres://postgres:postgres@localhost:5432
|
|
||||||
|
|
||||||
- name: Run Logto
|
- name: Run Logto
|
||||||
working-directory: logto/packages/core
|
working-directory: logto/packages/core
|
||||||
run: node . --from-root --all-yes &
|
run: node . &
|
||||||
env:
|
env:
|
||||||
INTEGRATION_TEST: true
|
INTEGRATION_TEST: true
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
|
@ -103,7 +96,7 @@ jobs:
|
||||||
# Test
|
# Test
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
cd /tmp/tests/packages/integration-tests
|
cd tests/packages/integration-tests
|
||||||
pnpm start
|
pnpm start
|
||||||
env:
|
env:
|
||||||
INTEGRATION_TESTS_LOGTO_URL: http://localhost:3001
|
INTEGRATION_TESTS_LOGTO_URL: http://localhost:3001
|
||||||
|
|
|
@ -8,8 +8,8 @@ tasks:
|
||||||
pnpm prepack
|
pnpm prepack
|
||||||
cd packages/core
|
cd packages/core
|
||||||
pnpm build
|
pnpm build
|
||||||
pnpm add-official-connectors
|
|
||||||
cd -
|
cd -
|
||||||
|
pnpm cli connector add --official
|
||||||
command: |
|
command: |
|
||||||
export ENDPOINT=$(gp url 3001)
|
export ENDPOINT=$(gp url 3001)
|
||||||
pnpm cli db seed
|
pnpm cli db seed
|
||||||
|
|
|
@ -14,9 +14,8 @@ RUN pnpm i
|
||||||
RUN pnpm -- lerna run build --stream
|
RUN pnpm -- lerna run build --stream
|
||||||
|
|
||||||
# Add official connectors
|
# Add official connectors
|
||||||
WORKDIR /etc/logto/packages/core
|
|
||||||
RUN pnpm add-official-connectors
|
|
||||||
WORKDIR /etc/logto
|
WORKDIR /etc/logto
|
||||||
|
RUN pnpm cli connector add --official
|
||||||
|
|
||||||
# Prune dependencies for production
|
# Prune dependencies for production
|
||||||
RUN rm -rf node_modules packages/*/node_modules
|
RUN rm -rf node_modules packages/*/node_modules
|
||||||
|
@ -30,5 +29,4 @@ FROM node:16-alpine as app
|
||||||
WORKDIR /etc/logto
|
WORKDIR /etc/logto
|
||||||
COPY --from=builder /etc/logto .
|
COPY --from=builder /etc/logto .
|
||||||
EXPOSE 3001
|
EXPOSE 3001
|
||||||
ENV NO_INQUIRY true
|
|
||||||
ENTRYPOINT ["npm", "start"]
|
ENTRYPOINT ["npm", "start"]
|
||||||
|
|
11
package.json
11
package.json
|
@ -10,11 +10,9 @@
|
||||||
"prepare": "if test \"$NODE_ENV\" != \"production\" && test \"$CI\" != \"true\" ; then husky install ; fi",
|
"prepare": "if test \"$NODE_ENV\" != \"production\" && test \"$CI\" != \"true\" ; then husky install ; fi",
|
||||||
"prepack": "lerna run --stream prepack",
|
"prepack": "lerna run --stream prepack",
|
||||||
"dev": "lerna run --stream prepack -- --incremental && lerna --ignore=@logto/integration-tests run --parallel dev",
|
"dev": "lerna run --stream prepack -- --incremental && lerna --ignore=@logto/integration-tests run --parallel dev",
|
||||||
"start": "cd packages/core && NODE_ENV=production node . --from-root",
|
"start": "cd packages/core && NODE_ENV=production node .",
|
||||||
"//": "For production, use NPM instead",
|
"cli": "logto",
|
||||||
"cli": "cd packages/core && npm run cli",
|
"alteration": "logto db alt",
|
||||||
"//": "For production, use NPM instead",
|
|
||||||
"alteration": "cd packages/core && npm run alteration",
|
|
||||||
"ci:build": "lerna run --stream build",
|
"ci:build": "lerna run --stream build",
|
||||||
"ci:lint": "lerna run --parallel lint",
|
"ci:lint": "lerna run --parallel lint",
|
||||||
"ci:stylelint": "lerna run --parallel stylelint",
|
"ci:stylelint": "lerna run --parallel stylelint",
|
||||||
|
@ -52,5 +50,8 @@
|
||||||
"jest": "^29.1.2"
|
"jest": "^29.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@logto/cli": "^1.0.0-beta.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,6 @@
|
||||||
"lint:report": "pnpm lint --format json --output-file report.json",
|
"lint:report": "pnpm lint --format json --output-file report.json",
|
||||||
"dev": "rm -rf build/ && pnpm run copyfiles && nodemon",
|
"dev": "rm -rf build/ && pnpm run copyfiles && nodemon",
|
||||||
"start": "NODE_ENV=production node build/index.js",
|
"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": "jest",
|
||||||
"test:ci": "jest --coverage --silent",
|
"test:ci": "jest --coverage --silent",
|
||||||
"test:report": "codecov -F core"
|
"test:report": "codecov -F core"
|
||||||
|
|
|
@ -7,9 +7,12 @@ importers:
|
||||||
'@commitlint/cli': ^17.0.0
|
'@commitlint/cli': ^17.0.0
|
||||||
'@commitlint/config-conventional': ^17.0.0
|
'@commitlint/config-conventional': ^17.0.0
|
||||||
'@commitlint/types': ^17.0.0
|
'@commitlint/types': ^17.0.0
|
||||||
|
'@logto/cli': ^1.0.0-beta.10
|
||||||
husky: ^8.0.0
|
husky: ^8.0.0
|
||||||
lerna: ^5.0.0
|
lerna: ^5.0.0
|
||||||
typescript: ^4.7.4
|
typescript: ^4.7.4
|
||||||
|
dependencies:
|
||||||
|
'@logto/cli': link:packages/cli
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@commitlint/cli': 17.0.0
|
'@commitlint/cli': 17.0.0
|
||||||
'@commitlint/config-conventional': 17.0.0
|
'@commitlint/config-conventional': 17.0.0
|
||||||
|
|
Loading…
Reference in a new issue