From 9a94fdf9f4cf101d10f7353f2bda21381de99a8b Mon Sep 17 00:00:00 2001 From: "Michael B. Klein" Date: Fri, 24 May 2024 10:02:07 -0500 Subject: [PATCH] Add Github Actions test workflow --- .circleci/config.yml | 14 +---------- .github/workflows/test.yml | 51 ++++++++++++++++++++++++++++++++++++++ .vscode/settings.json | 5 ---- 3 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .vscode/settings.json diff --git a/.circleci/config.yml b/.circleci/config.yml index 9642d92..6007888 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,11 +21,6 @@ jobs: - node-modules-v1-{{ checksum "package-lock.json" }}-{{ .Branch }} - node-modules-v1-{{ checksum "package-lock.json" }}- - node-modules-v1- - - run: - name: Download cc-test-reporter - command: | - curl -L -o ./cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 - chmod +x ./cc-test-reporter - run: name: Install JS Dependencies command: npm install @@ -35,11 +30,4 @@ jobs: - ~/serverless-iiif/node_modules - run: name: JS Tests - command: | - ./cc-test-reporter before-build - npm run-script test-coverage - mv coverage/clover.xml ./clover.xml - ./cc-test-reporter after-build --coverage-input-type clover --exit-code $? - - run: - name: Send coverage to Coveralls - command: yarn run coveralls < coverage/lcov.info + command: npm run-script test-coverage diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..61d5c1e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,51 @@ +--- +name: Run Tests +on: + - push +concurrency: + group: "tests" + cancel-in-progress: false +jobs: + lts-runtime: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: ['lts/-2', 'lts/-1'] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: package-lock.json + - name: Install Dependencies + run: npm ci + - name: Run Tests + run: npm run test + current-runtime: + runs-on: ubuntu-latest + needs: lts-runtime + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: lts/* + cache: npm + cache-dependency-path: package-lock.json + - name: Install Dependencies + run: npm ci + - name: Setup Code Climate + uses: remarkablemark/setup-codeclimate@v2 + - name: Run Tests + run: | + cc-test-reporter before-build + npm run test-coverage + cc-test-reporter after-build --exit-code $? + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + - name: Send coverage to Coveralls + uses: coverallsapp/github-action@v2 diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 0b1477a..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "editor.codeActionsOnSave": { - "source.fixAll.sortJSON": false - } -}