File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Tests
2+
3+ on :
4+ pull_request :
5+ types : [opened, reopened, synchronize]
6+
7+ jobs :
8+
9+ checkChangedFiles :
10+ runs-on : ubuntu-latest
11+ outputs :
12+ files : ${{ steps.files.outputs.added_modified }}
13+ steps :
14+ - uses : actions/checkout@v2
15+ - id : files
16+ uses : Ana06/get-changed-files@v1.2
17+ with :
18+ format : ' csv'
19+ filter : ' *.mdx?'
20+
21+ tests :
22+ runs-on : ubuntu-latest
23+ needs : checkChangedFiles
24+ if : ${{ needs.checkChangedFiles.outputs.files != '' }}
25+ steps :
26+ - uses : actions/checkout@v2
27+ - uses : actions/setup-node@v1
28+ with :
29+ node-version : 22
30+
31+ - run : npm ci
32+
33+ # Set up remote tests
34+ - run : git clone https://gitlab.com/nomadic-labs/doclib.git
35+ - run : cd doclib
36+ - run : npm i
37+
38+ # Tests:
39+ # - Run tests from the doclib repo
40+ # - Pass the changed files as a comma-separated list
41+
42+ # Image links check
43+ - run : npm run imageLinks -- --baseFolder=.. --imageFolder=static --docFiles=${{ needs.checkChangedFiles.outputs.files }} --reporter mocha-junit-reporter --reporter-options mochaFile=../imageLinks.xml
44+ continue-on-error : true
45+
46+ # Unused images check
47+ - run : npm run usedImages -- --baseFolder=.. --docFiles=docs --imageFolder=static --ignoreImages=img/site --reporter mocha-junit-reporter --reporter-options mochaFile=../usedImages.xml
48+ continue-on-error : true
49+
50+ # Dependency proposer
51+ - run : npm run proposeDependencies -- --baseFolder=.. --docFiles=${{ needs.checkChangedFiles.outputs.files }} --major --reporter mocha-junit-reporter --reporter-options mochaFile=../proposedDependencies.xml
52+ continue-on-error : true
53+
54+ # Report tests on PR
55+ - uses : dorny/test-reporter@v2
56+ if : ${{ !cancelled() }}
57+ with :
58+ name : Mocha tests
59+ path :
60+ - imageLinks.xml
61+ - usedImages.xml
62+ - proposedDependencies.xml
63+ reporter : mocha-json
You can’t perform that action at this time.
0 commit comments