我目前正在完成从 travis CI 到 Github Actions CI 的迁移,但是当容器尝试连接到我的测试数据库时,我的构建一直失败。
这是一个非常普遍的错误
UNKNOWN_CODE_PLEASE_REPORT:发生内部错误。请重试或报告您的问题。
at Handshake.Object.<anonymous>.Sequence._packetToError (node_modules/***/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.Object.<anonymous>.Handshake.ErrorPacket (node_modules/***/lib/protocol/sequences/Handshake.js:123:18)
at Protocol.Object.<anonymous>.Protocol._parsePacket (node_modules/***/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (node_modules/***/lib/protocol/Parser.js:433:10)
at Parser.write (node_modules/***/lib/protocol/Parser.js:43:10)
at Protocol.Object.<anonymous>.Protocol.write (node_modules/***/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (node_modules/***/lib/Connection.js:88:28)
at Socket.<anonymous> (node_modules/***/lib/Connection.js:526:10)
附加说明:我的测试数据库托管在 Azure(mysql 服务器)上,我的测试在本地执行良好,之前在 travis 上执行。项目详情:NodeJs 项目为 MySql 运行 TypeOrm。
这是我的 yml 的当前基本版本的样子:
on:
pull_request:
branches: [master, develop]
defaults:
run:
working-directory: ./Server
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
with:
node_version: 14.x
uses: actions/setup-node@v1
- name: Run tests
run: |
npm install
npx jest --coverage --config ./jest.config.js
env:
TEST_DB_NAME: ${{ secrets.TEST_DB_NAME }}
TEST_DB_PORT: ${{ secrets.TEST_DB_PORT }}
TEST_DB_TYPE: ${{ secrets.TEST_DB_TYPE }}
TEST_HOST: ${{ secrets.TEST_HOST }}
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
TEST_PORT: ${{ secrets.TEST_PORT }}
ACCESS_SECRET_KEY: ${{ secrets.ACCESS_SECRET_KEY }} ```