From ed5e7a2e6919eae1569a8093978bd03ed818a75d Mon Sep 17 00:00:00 2001 From: ianwremmel <1182361+ianwremmel@users.noreply.github.com> Date: Sun, 16 Feb 2020 17:25:27 -0800 Subject: [PATCH] test: add a workflow which submits a mock test result --- .github/workflows/example.yml | 17 +++++++++++++++++ example/index.spec.js | 5 +++++ example/junit.xml | 17 +++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .github/workflows/example.yml create mode 100644 example/index.spec.js create mode 100644 example/junit.xml diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml new file mode 100644 index 0000000..1e0f82d --- /dev/null +++ b/.github/workflows/example.yml @@ -0,0 +1,17 @@ +on: push +name: Example +jobs: + example: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - run: | + mkdir -p ./reports/junit/ + cp ./example/junit.xml ./reports/junit/ + # I can't find a way to make the branch name below dynamic, so we'l + # need to remember to adjust it when working on features. + - uses: check-run-reporter/action@master + env: + CHECK_RUN_REPORTER_LABEL: 'Unit Tests' + CHECK_RUN_REPORTER_REPORT: 'reports/junit/**/*.xml' + CHECK_RUN_REPORTER_TOKEN: ${{ secrets.CHECK_RUN_REPORTER_TOKEN }} diff --git a/example/index.spec.js b/example/index.spec.js new file mode 100644 index 0000000..c053c1b --- /dev/null +++ b/example/index.spec.js @@ -0,0 +1,5 @@ +describe('example', () => { + it('does not fail', () => { + expect(false).toBe(true); + }); +}); diff --git a/example/junit.xml b/example/junit.xml new file mode 100644 index 0000000..628482d --- /dev/null +++ b/example/junit.xml @@ -0,0 +1,17 @@ + + + + + Error: expect(received).toBe(expected) // Object.is equality + +Expected: true +Received: false + at Object.<anonymous> (/github/workspace/example/index.spec.js:3:19) + at Object.asyncJestTest (/github/workspace/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:102:37) + at /github/workspace/node_modules/jest-jasmine2/build/queueRunner.js:43:12 + at new Promise (<anonymous>) + at mapper (/github/workspace/node_modules/jest-jasmine2/build/queueRunner.js:26:19) + at /github/workspace/node_modules/jest-jasmine2/build/queueRunner.js:73:41 + + +