]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/.github/workflows/remark.yml
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
[rust.git] / src / tools / clippy / .github / workflows / remark.yml
1 name: Remark
2
3 on:
4   push:
5     branches:
6       - auto
7       - try
8   pull_request:
9     paths:
10     - '**.md'
11
12 jobs:
13   remark:
14     runs-on: ubuntu-latest
15
16     steps:
17     # Setup
18     - name: Checkout
19       uses: actions/checkout@v3.0.2
20
21     - name: Setup Node.js
22       uses: actions/setup-node@v1.4.4
23       with:
24         node-version: '14.x'
25
26     - name: Install remark
27       run: npm install remark-cli remark-lint remark-lint-maximum-line-length remark-preset-lint-recommended remark-gfm
28
29     - name: Install mdbook
30       run: |
31         mkdir mdbook
32         curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.18/mdbook-v0.4.18-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
33         echo `pwd`/mdbook >> $GITHUB_PATH
34
35     # Run
36     - name: Check *.md files
37       run: git ls-files -z '*.md' | xargs -0 -n 1 -I {} ./node_modules/.bin/remark {} -u lint -f > /dev/null
38
39     - name: Build mdbook
40       run: mdbook build book
41
42   # These jobs doesn't actually test anything, but they're only used to tell
43   # bors the build completed, as there is no practical way to detect when a
44   # workflow is successful listening to webhooks only.
45   #
46   # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
47
48   end-success:
49     name: bors remark test finished
50     if: github.event.pusher.name == 'bors' && success()
51     runs-on: ubuntu-latest
52     needs: [remark]
53
54     steps:
55       - name: Mark the job as successful
56         run: exit 0
57
58   end-failure:
59     name: bors remark test finished
60     if: github.event.pusher.name == 'bors' && (failure() || cancelled())
61     runs-on: ubuntu-latest
62     needs: [remark]
63
64     steps:
65       - name: Mark the job as a failure
66         run: exit 1