Add Github workflows

These should do the checks for us.
Not an expert though so it may need a bit of tweaking before they do
what we want them to do.
This commit is contained in:
Jean-Michel Picod
2020-02-24 19:00:51 +01:00
parent 292da30cad
commit feacd72d6e
3 changed files with 124 additions and 0 deletions

18
.github/workflows/mdlint.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: markdownlint
on:
push:
paths:
- '**/*.md'
- '.markdownlint.json'
- '!third_party/**'
jobs:
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: markdownlint-cli
uses: nosborn/github-action-markdown-cli@v1.1.1
with:
files: **/*.md
config_file: ".markdownlint.json"

27
.github/workflows/pylint.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: pylint
on:
push:
paths:
- '**/*.py'
- '.pylintrc'
- '!third_party/**'
jobs:
pylint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install tockloader
- name: Test code with pylint
run: |
pip install pylint
pylint --rcfile=.pylintrc

79
.github/workflows/rust.yml vendored Normal file
View File

@@ -0,0 +1,79 @@
on:
push:
paths:
- 'examples/*.rs'
- 'libraries/**/*.rs'
- 'src/**/*.rs'
- 'patches/**'
- '**/Cargo.toml'
- '.cargo/config'
- '!third_party/**'
jobs:
initial_setup:
name: Set up project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: thumbv7em-none-eabi
override: true
- run: ./setup.sh
cargo_format_src:
name: Cargo format src/
needs: initial_setup
steps:
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
cargo_format_cbor:
name: Cargo format libraries/cbor
needs: initial_setup
steps:
- uses: actions-rs/cargo@v1
working-directory: libraries/cbor
with:
command: fmt
args: --all -- --check
cargo_format_crypto:
name: Cargo format libraries/crypto
needs: initial_setup
steps:
- uses: actions-rs/cargo@v1
working-directory: libraries/crypto
with:
command: fmt
args: --all -- --check
cargo_check:
name: Cargo Check
needs: initial_setup
steps:
- name: Check OpenSK w/o features
uses: actions-rs/cargo@v1
with:
command: check
args: --target thumbv7em-none-eabi --release
- name: Check OpenSK with_ctap1
uses: actions-rs/cargo@v1
with:
command: check
args: --target thumbv7em-none-eabi --release --features with_ctap1
- name: Check OpenSK debug_ctap
uses: actions-rs/cargo@v1
with:
command: check
args: --target thumbv7em-none-eabi --release --features debug_ctap
- name: Check OpenSK debug_ctap,with_ctap1
uses: actions-rs/cargo@v1
with:
command: check
args: --target thumbv7em-none-eabi --release --features debug_ctap,with_ctap1
- name: Check examples
uses: actions-rs/cargo@v1
with:
command: check
args: --target thumbv7em-none-eabi --release --examples