forked from Imagelibrary/seL4
github: add workflow actions for style checks
This replicates some of the TS-internal CI checks directly on github for faster feedback. Signed-off-by: Gerwin Klein <gerwin.klein@data61.csiro.au>
This commit is contained in:
committed by
Gerwin Klein
parent
ba5540fa75
commit
3f9a4cd809
35
.github/workflows/git.yaml
vendored
Normal file
35
.github/workflows/git.yaml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
name: Git
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
gitlint:
|
||||
name: Gitlint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 2
|
||||
- run: |
|
||||
git fetch --depth 1 --no-tags origin +refs/heads/${{ github.base_ref }}:refs/heads/${{ github.base_ref }}
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- name: Install gitlint
|
||||
run: pip install gitlint
|
||||
- name: Run gitlint
|
||||
run: gitlint --commits ${{ github.base_ref }}..${{ github.event.pull_request.head.sha }} lint
|
||||
|
||||
whitespace:
|
||||
name: Trailing Whitespace
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: |
|
||||
git fetch --depth 1 --no-tags origin +refs/heads/${{ github.base_ref }}:refs/heads/${{ github.base_ref }}
|
||||
- name: Check
|
||||
run: git diff --check ${{ github.base_ref }}
|
||||
20
.github/workflows/license.yaml
vendored
Normal file
20
.github/workflows/license.yaml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
name: License
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: License Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Check
|
||||
uses: fsfe/reuse-action@master
|
||||
47
.github/workflows/style.yaml
vendored
Normal file
47
.github/workflows/style.yaml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
name: Style
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
style:
|
||||
name: Check Style
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: seL4/sel4_tools
|
||||
path: sel4_tools
|
||||
- uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.7'
|
||||
- name: Install python packages
|
||||
run: pip install sel4-deps
|
||||
- name: Install astyle
|
||||
run: sudo apt-get install astyle
|
||||
- name: Run style check
|
||||
run: |
|
||||
sel4_tools/misc/style-all.sh ${{ env.GIT_DIFF }}
|
||||
[ -z "$(git status -u no --porcelain)" ] || (git diff; exit 1)
|
||||
|
||||
shell:
|
||||
name: Check shell scripts
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: technote-space/get-diff-action@v1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: seL4/sel4_tools
|
||||
path: sel4_tools
|
||||
- name: Install
|
||||
run: sudo apt-get install devscripts
|
||||
- name: Run shell script check
|
||||
run: |
|
||||
sel4_tools/misc/is-valid-shell-script ${{ env.GIT_DIFF }}
|
||||
Reference in New Issue
Block a user