Add github actions + Linting (#27)

* Add github actions
* Linting
This commit is contained in:
Mike
2020-10-22 20:44:21 +08:00
committed by GitHub
parent b57b780fea
commit 7bac08a89b
4 changed files with 90 additions and 15 deletions

20
.github/workflows/docker.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Docker
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build --no-cache . --file Dockerfile --tag mikenye/picard:testing

45
.github/workflows/linting.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
name: Linting
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pull koalaman/shellcheck:stable Image
run: docker pull koalaman/shellcheck:stable
- name: Run Shellcheck against shell scripts
run: docker run --rm -i -v "$PWD:/mnt" koalaman/shellcheck:stable $(find . -type f -exec grep -m1 -l -E '^#!.*sh.*' {} \; | grep -v '/.git/')
# docker run --rm -i -v "$PWD:/mnt" koalaman/shellcheck:stable $(find . -type f -exec grep -m1 -l -E '^#!.*execline.*' {} \; | grep -v '/.git/')
hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pull hadolint/hadolint:latest Image
run: docker pull hadolint/hadolint:latest
- name: Run hadolint against Dockerfiles
run: docker run --rm -i -v "$PWD":/workdir --workdir /workdir --entrypoint hadolint hadolint/hadolint --ignore DL3008 --ignore SC2068 --ignore SC1091 --ignore DL3013 $(find . -type f -iname "Dockerfile*")
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Pull markdownlint/markdownlint:latest Image
run: docker pull markdownlint/markdownlint:latest
- name: Run markdownlint against *.md files
run: docker run --rm -i -v "$(pwd)":/workdir --workdir /workdir markdownlint/markdownlint:latest --rules ~MD013,~MD033,~MD029 $(find . -type f -iname '*.md' | grep -v '/.git/')