Compare commits

...

1 Commits

Author SHA1 Message Date
chris48s
57036a34b0 migrate integration tests to GH actions 2022-09-22 20:44:43 +01:00
4 changed files with 92 additions and 42 deletions

View File

@@ -1,27 +1,5 @@
version: 2
integration_steps: &integration_steps
steps:
- checkout
- run:
name: Install dependencies
command: |
npm ci
environment:
CYPRESS_INSTALL_BINARY: 0
- run:
name: Integration tests
when: always
environment:
mocha_reporter: mocha-junit-reporter
MOCHA_FILE: junit/integration/results.xml
command: npm run test:integration
- store_test_results:
path: junit
services_steps: &services_steps
steps:
- checkout
@@ -48,22 +26,6 @@ services_steps: &services_steps
path: junit
jobs:
integration:
docker:
- image: cimg/node:16.15
- image: redis
<<: *integration_steps
integration@node-17:
docker:
- image: cimg/node:17.9
- image: redis
environment:
NPM_CONFIG_ENGINE_STRICT: 'false'
<<: *integration_steps
danger:
docker:
- image: cimg/node:16.15
@@ -185,10 +147,6 @@ workflows:
on-commit:
jobs:
- integration@node-17:
filters:
branches:
ignore: gh-pages
- frontend:
filters:
branches:

View File

@@ -0,0 +1,20 @@
name: 'Integration tests'
description: 'Run integration tests'
inputs:
github-token:
description: 'The GITHUB_TOKEN secret'
required: true
runs:
using: 'composite'
steps:
- name: Integration Tests
if: always()
run: npm run test:integration -- --reporter json --reporter-option 'output=reports/integration-tests.json'
env:
GH_TOKEN: '${{ inputs.github-token }}'
shell: bash
- name: Write Markdown Summary
if: always()
run: node scripts/mocha2md.js Integration reports/integration-tests.json >> $GITHUB_STEP_SUMMARY
shell: bash

View File

@@ -0,0 +1,37 @@
name: Integration@node 17
on:
pull_request:
push:
branches-ignore:
- 'gh-pages'
jobs:
test-integration-17:
runs-on: ubuntu-latest
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 17
env:
NPM_CONFIG_ENGINE_STRICT: 'false'
- name: Integration Tests
uses: ./.github/actions/integration-tests
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'

35
.github/workflows/test-integration.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Integration
on:
pull_request:
push:
branches-ignore:
- 'gh-pages'
jobs:
test-integration:
runs-on: ubuntu-latest
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: ./.github/actions/setup
with:
node-version: 16
- name: Integration Tests
uses: ./.github/actions/integration-tests
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'