diff --git a/.github/workflows/pr-deploy-route-test.yml b/.github/workflows/pr-deploy-route-test.yml index ffe99c9060..3517a5dd0f 100644 --- a/.github/workflows/pr-deploy-route-test.yml +++ b/.github/workflows/pr-deploy-route-test.yml @@ -58,7 +58,7 @@ jobs: run: | set -ex gzip -cvd docker-image/rsshub.tar.gz | docker load - docker run -d -p 1200:1200 rsshub:latest + docker run -d --name rsshub -e NODE_ENV=dev -p 1200:1200 rsshub:latest - uses: actions/setup-node@v3 # just need its cache if: (env.TEST_CONTINUE) @@ -88,3 +88,7 @@ jobs: const got = require("got"); const script = require(`${process.env.GITHUB_WORKSPACE}/scripts/workflow/test-route/test.js`) return await script({ github, context, core, got }, link, routes, number) + + - name: Print Docker container logs + if: (env.TEST_CONTINUE) + run: docker logs rsshub # logs/combined.log? Not so readable... diff --git a/scripts/workflow/test-route/test.js b/scripts/workflow/test-route/test.js index dde6b82eb2..3e28c9f04b 100644 --- a/scripts/workflow/test-route/test.js +++ b/scripts/workflow/test-route/test.js @@ -10,18 +10,27 @@ module.exports = async ({ github, context, core, got }, baseUrl, routes, number) return `${baseUrl}${l}`; }); - let com = 'Successfully generated as following:\n\n'; + let com = `Successfully [generated](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}) as following:\n\n`; for (const lks of links) { core.info(`testing route: ${lks}`); // Intended, one at a time const res = await got(lks).catch((err) => { + let errMsg = err.toString(); + const errInfoList = err.response && err.response.body && err.response.body.match(/(?<=