-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (53 loc) · 2.08 KB
/
on_pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
name: Pull Request
on:
# Enable manual running of action if necessary
workflow_dispatch:
# Test build/deploy on PRs to main/master
pull_request:
# Only publish on push to main branch
branches:
- main
# Don't trigger if it's just a documentation update
paths-ignore:
- "**.md"
- "**.MD"
- "**.yml"
- "LICENSE"
- ".gitattributes"
- ".gitignore"
- ".dockerignore"
jobs:
shellcheck:
name: Run shellcheck against shell scripts
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/[email protected]
- 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/')
hadolint:
name: Run hadolint against docker files
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/[email protected]
- 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 DL3003 --ignore DL3006 --ignore DL3010 --ignore DL4001 --ignore DL3007 --ignore DL3008 --ignore SC2068 --ignore DL3007 --ignore SC1091 --ignore DL3013 --ignore DL3010 $(find . -type f -iname "Dockerfile*")
build_and_push:
name: Test Image Build
uses: sdr-enthusiasts/common-github-workflows/.github/workflows/build_and_push_image.yml@main
needs: [shellcheck, hadolint] # don't run unless all linting passes
with:
push_enabled: false
ghcr_repo_owner: ${{ github.repository_owner }}
ghcr_repo: ${{ github.repository }}
platform_linux_arm32v6_enabled: false
platform_linux_i386_enabled: true
get_version_method: git_commit_hash_short
secrets:
ghcr_token: ${{ secrets.GITHUB_TOKEN }}