From f13bc6cb2ed915d3013b7b9f400636cdebe329a2 Mon Sep 17 00:00:00 2001 From: Murph Murphy Date: Fri, 12 May 2023 15:32:42 -0600 Subject: [PATCH] Switch to reusable ts ci workflow (#101) * Switch to reusable ts ci workflow * Skip coverage * Update to stable tag version --- .github/typescript-ci-patch.yaml | 16 ------------- .github/workflows/typescript-ci.yaml | 35 +++++++--------------------- .gitignore | 3 ++- package.json | 2 +- 4 files changed, 12 insertions(+), 44 deletions(-) delete mode 100644 .github/typescript-ci-patch.yaml diff --git a/.github/typescript-ci-patch.yaml b/.github/typescript-ci-patch.yaml deleted file mode 100644 index b0c2821..0000000 --- a/.github/typescript-ci-patch.yaml +++ /dev/null @@ -1,16 +0,0 @@ -- op: replace - path: /jobs/test/strategy/matrix/node_version - value: ["14", "16", "18"] - -# Coverage will be above the values in `jest.config.js` -- op: test - path: /jobs/test/steps/4/name - value: Check test coverage -- op: remove - path: /jobs/test/steps/4 -- op: test - path: /jobs/test/steps/3/name - value: Run tests -- op: replace - path: /jobs/test/steps/3/run - value: yarn test --coverage diff --git a/.github/workflows/typescript-ci.yaml b/.github/workflows/typescript-ci.yaml index f1a84e9..0bff471 100644 --- a/.github/workflows/typescript-ci.yaml +++ b/.github/workflows/typescript-ci.yaml @@ -1,11 +1,4 @@ -# DO NOT EDIT THIS FILE. -# Instead, edit the jsonpatch file (actually YAML) in .github/typescript-ci-patch.yaml -# For docs, see github-actions in the IronCoreLabs/depot repo. - -name: TypeScript CI -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true +name: Typescript CI 'on': push: branches: @@ -13,21 +6,11 @@ concurrency: pull_request: null workflow_dispatch: null jobs: - test: - runs-on: ubuntu-22.04 - strategy: - matrix: - node_version: - - '14' - - '16' - - '18' - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node_version }} - cache: yarn - - name: Install modules - run: yarn - - name: Run tests - run: yarn test --coverage + typescript-ci: + uses: IronCoreLabs/workflows/.github/workflows/typescript-ci.yaml@typescript-ci-v0 + with: + test_matrix_node_version: '["14", "16", "18"]' + # this repo runs coverage in its default test command, which will fail if + # under the thresholds defined in jest.config.js, so coverage delta doesn't matter as much + run_coverage: false + secrets: inherit diff --git a/.gitignore b/.gitignore index 7110675..b00b06f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ dist/ coverage/* integration/private.key integration/.device.json -integration/project.json \ No newline at end of file +integration/project.json +.direnv diff --git a/package.json b/package.json index 497e95b..058b211 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "start": "_ICL_API_DOMAIN_REPLACEMENT_=http://localhost:9090 ts-node -- ./integration/index.ts", "build": "./build.js", "test": "yarn run lint && yarn run unit", - "unit": "jest", + "unit": "jest --coverage", "lint": "tslint -p \"tsconfig.json\" -e \"**/tests/**\" \"src/**/*.ts\"" }, "dependencies": {