Skip to content

Use remote tests

Use remote tests #7

Workflow file for this run

name: Tests
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
checkChangedFiles:
runs-on: ubuntu-latest
outputs:
files: ${{ steps.files.outputs.added_modified }}
steps:
- uses: actions/checkout@v2
- id: files
uses: Ana06/get-changed-files@v1.2
with:
format: 'csv'
filter: '*.mdx?'
tests:
runs-on: ubuntu-latest
needs: checkChangedFiles
if: ${{ needs.checkChangedFiles.outputs.files != '' }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 22
- run: npm ci
# Set up remote tests
- run: git clone https://gitlab.com/nomadic-labs/doclib.git
- run: npm i
working-directory: doclib
# Tests:
# - Run tests from the doclib repo
# - Pass the changed files as a comma-separated list
# Image links check
- run: npm run imageLinks -- --baseFolder=.. --imageFolder=static --docFiles=${{ needs.checkChangedFiles.outputs.files }} --reporter mocha-junit-reporter --reporter-options mochaFile=../imageLinks.xml
continue-on-error: true
working-directory: doclib
# Unused images check
- run: npm run usedImages -- --baseFolder=.. --docFiles=docs --imageFolder=static --ignoreImages=img/site --reporter mocha-junit-reporter --reporter-options mochaFile=../usedImages.xml
continue-on-error: true
working-directory: doclib
# Dependency proposer
- run: npm run proposeDependencies -- --baseFolder=.. --docFiles=${{ needs.checkChangedFiles.outputs.files }} --major --reporter mocha-junit-reporter --reporter-options mochaFile=../proposedDependencies.json
continue-on-error: true
working-directory: doclib
# Report tests on PR
- uses: dorny/test-reporter@v2
if: ${{ !cancelled() }}
with:
name: Image link tests
path: imageLinks.json
reporter: mocha-json
- uses: dorny/test-reporter@v2
if: ${{ !cancelled() }}
with:
name: Used image tests
path: usedImages.json
reporter: mocha-json
- uses: dorny/test-reporter@v2
if: ${{ !cancelled() }}
with:
name: Propose dependencies
path: proposedDependencies.json
reporter: mocha-json