Skip to content

WIP workflow to run tests #2

WIP workflow to run tests

WIP workflow to run tests #2

Workflow file for this run

name: Automated test for PRs
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
getChangedFiles:
runs-on: ubuntu-latest
outputs:
files: ${{ steps.changed-markdown-files.outputs.all_changed_files }}
steps:
# Get files that are added or changed in this PR
# https://github.com/marketplace/actions/changed-files
- name: Get all changed MD/MDX files
id: changed-markdown-files
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
with:
files: 'docs/**.{md,mdx}'
test:
runs-on: ubuntu-latest
needs: getChangedFiles
if: ${{ needs.getChangedFiles.outputs.files != '' }}
steps:
# Clone the repo and install dependencies
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 20
- run: npm ci
# Clone tests from https://gitlab.com/nomadic-labs/doclib
# Uses https://github.com/marketplace/actions/any-clone-repo
- name: Clone test repo
uses: chihqiang/checkout-action@main
with:
repo: 'https://gitlab.com/nomadic-labs/doclib.git'
branch: 'main'
# Run tests
- run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done