linting and doc workflow

This commit is contained in:
realaravinth 2021-06-09 19:47:09 +05:30
parent 2b9144f560
commit 5737fca771
No known key found for this signature in database
GPG key ID: AD9F0F08E855ED88
3 changed files with 114 additions and 19 deletions

42
.github/workflows/clippy-fmt.yml vendored Normal file
View file

@ -0,0 +1,42 @@
name: Lint
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
- name: Check with rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Check with Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --tests --all-features

View file

@ -38,7 +38,7 @@ jobs:
override: false
- name: install dependencies
run: make dev-env
run: make env
- name: build docker image
run: make docker-build
@ -78,21 +78,21 @@ jobs:
with:
file: cobertura.xml
- name: generate documentation
if: matrix.version == 'stable' && (github.repository == 'mcaptcha/cache')
run: make doc
# - name: generate documentation
# if: matrix.version == 'stable' && (github.repository == 'realaravinth/damn-vuln-blockchain')
# uses: actions-rs/cargo@v1
# with:
# command: doc
# args: --no-deps --workspace --all-features
- name: Deploy to GitHub Pages
if: matrix.version == 'stable' && (github.repository == 'mcaptcha/cache')
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: target/doc
# - name: generate documentation
# if: matrix.version == 'stable' && (github.repository == 'mcaptcha/cache')
# run: make doc
#
# # - name: generate documentation
# # if: matrix.version == 'stable' && (github.repository == 'realaravinth/damn-vuln-blockchain')
# # uses: actions-rs/cargo@v1
# # with:
# # command: doc
# # args: --no-deps --workspace --all-features
#
# - name: Deploy to GitHub Pages
# if: matrix.version == 'stable' && (github.repository == 'mcaptcha/cache')
# uses: JamesIves/github-pages-deploy-action@3.7.1
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# BRANCH: gh-pages
# FOLDER: target/doc

53
.github/workflows/upload-doc.yml vendored Normal file
View file

@ -0,0 +1,53 @@
name: Upload Documentation
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable-x86_64-unknown-linux-gnu
profile: minimal
override: true
- name: generate documentation
if: matrix.version == 'stable' && (github.repository == 'mcaptcha/cache')
run: make doc
# - name: generate documentation
# if: matrix.version == 'stable' && (github.repository == 'realaravinth/damn-vuln-blockchain')
# uses: actions-rs/cargo@v1
# with:
# command: doc
# args: --no-deps --workspace --all-features
- name: Deploy to GitHub Pages
if: matrix.version == 'stable' && (github.repository == 'mcaptcha/cache')
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: target/doc
# - name: generate documentation
# if: github.repository == 'mCaptcha/libmcaptcha'
# uses: actions-rs/cargo@v1
# with:
# command: doc
# args: --no-deps --workspace --all-features
#
# - name: Deploy to GitHub Pages
# if: github.repository == 'mCaptcha/libmcaptcha'
# uses: JamesIves/github-pages-deploy-action@3.7.1
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# BRANCH: gh-pages
# FOLDER: target/doc