on master help sign in
Add github action to lint unmerged docs
70c989eGokul Soumya
.github/workflows/build.yml+48
@@ -137,3 +137,51 @@ jobs:
137 with:
137 with:
138 command: clippy
138 command: clippy
139 args: -- -D warnings
139 args: -- -D warnings
140+
141+ docs:
142+ name: Docs
143+ runs-on: ubuntu-latest
144+ steps:
145+ - name: Checkout sources
146+ uses: actions/checkout@v2
147+ with:
148+ submodules: true
149+
150+ - name: Install stable toolchain
151+ uses: actions-rs/toolchain@v1
152+ with:
153+ profile: minimal
154+ toolchain: stable
155+ override: true
156+
157+ - name: Cache cargo registry
158+ uses: actions/cache@v2.1.6
159+ with:
160+ path: ~/.cargo/registry
161+ key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
162+
163+ - name: Cache cargo index
164+ uses: actions/cache@v2.1.6
165+ with:
166+ path: ~/.cargo/git
167+ key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }}
168+
169+ - name: Cache cargo target dir
170+ uses: actions/cache@v2.1.6
171+ with:
172+ path: target
173+ key: ${{ runner.os }}-v2-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
174+
175+ - name: Generate docs
176+ uses: actions-rs/cargo@v1
177+ with:
178+ command: xtask
179+ args: docgen
180+
181+ - name: Check uncommitted documentation changes
182+ run: |
183+ git diff
184+ git diff-files --quiet \
185+ || (echo "Run 'cargo xtask docgen', commit the changes and push again" \
186+ && exit 1)
187+