Skip to content

Commit 1dcf74c

Browse files
committed
Add CI linters
1 parent 197f3ac commit 1dcf74c

5 files changed

+33
-8
lines changed

.github/workflows/build-container-prep-image.yml

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
branches:
55
- main
66
pull_request:
7-
types:
8-
- opened
97

108
env:
119
IMAGE_NAME: hpcs/container-prep

.github/workflows/build-data-prep-image.yml

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
branches:
55
- main
66
pull_request:
7-
types:
8-
- opened
97

108
env:
119
IMAGE_NAME: hpcs/data-prep

.github/workflows/build-job-prep-image.yml

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
branches:
55
- main
66
pull_request:
7-
types:
8-
- opened
97

108
env:
119
IMAGE_NAME: hpcs/job-prep

.github/workflows/build-server-image.yml

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
branches:
55
- main
66
pull_request:
7-
types:
8-
- opened
97

108
env:
119
IMAGE_NAME: hpcs/server

.github/workflows/general-lint.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build and publish HPCS server image
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
8+
jobs:
9+
general_lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Checking for newlines at the end of files
14+
run: if (for file in $(find . -type f -not -path './.git/*' -not -path './.git-crypt/*' -not -path './terraform/secrets/*') ; do [ "$(tail -c 1 < "${file}")" == "" ] || echo "${file} has no newline at the end..." ; done) | grep . ; then exit 1 ; fi
15+
- name: Checking for trailing whitespaces
16+
run: if find . -type f -not -path './.git/*' -exec egrep -l " +$" {} \; | grep . ; then exit 1 ; fi
17+
18+
- name: Running shellcheck on *.sh files
19+
run: |
20+
find . -name .git -type d -prune -o -type f -name \*.sh -print0 |
21+
xargs -0 -r -n1 shellcheck
22+
helm_lint:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: run helm lint on hpcs-stack
27+
run: docker run --rm -v $(pwd)/k8s:/apps alpine/helm:latest lint hpcs-stack
28+
terraform_lint:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: run terraform fmt
33+
run: docker run --rm -v $(pwd):/data docker.io/hashicorp/terraform fmt -check /data/terraform

0 commit comments

Comments
 (0)