-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from sentoz/feature_update_workflow
ci: add mdlint, hadolint and workflow for PR
- Loading branch information
Showing
7 changed files
with
370 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
name: Check pull request | ||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
paths-ignore: | ||
- '**.md' | ||
- '**.png' | ||
- '**.jpg' | ||
- '**.svg' | ||
- '**.yaml' | ||
- CNAME | ||
- LICENSE | ||
|
||
concurrency: | ||
# Cancel any running workflow for the same branch when new commits are pushed. | ||
# We group both by ref_name (available when CI is triggered by a push to a branch/tag) | ||
# and head_ref (available when CI is triggered by a PR). | ||
group: "${{ github.workflow }}-${{ github.ref_name }}-${{ github.head_ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
linters: | ||
name: Linters | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Shellcheck | ||
uses: reviewdog/action-shellcheck@v1 | ||
with: | ||
reporter: github-pr-review | ||
pattern: "*.sh" | ||
exclude: "./.git/*" | ||
- name: markdownlint-cli | ||
uses: nosborn/github-action-markdown-cli@v3.3.0 | ||
with: | ||
files: . | ||
config_file: .markdownlint.yaml | ||
ignore_files: ./LICENSE | ||
- uses: gitleaks/gitleaks-action@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
hadolint: | ||
name: Hadolint | ||
needs: [linters] | ||
permissions: | ||
pull-requests: write | ||
issues: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: hadolint | ||
id: hadolint | ||
uses: hadolint/hadolint-action@v3.1.0 | ||
with: | ||
recursive: true | ||
- name: Update Pull Request | ||
uses: actions/github-script@v6 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
script: | | ||
const output = ` | ||
#### Hadolint: \`${{ steps.hadolint.outcome }}\` | ||
\`\`\` | ||
${process.env.HADOLINT_RESULTS} | ||
\`\`\` | ||
`; | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: output | ||
}) | ||
|
||
|
||
|
||
test_build_images: | ||
name: Test building all docker images | ||
needs: [hadolint] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: write | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ github.repository }} | ||
ghcr.io/${{ github.repository }} | ||
- name: Get PR Number | ||
id: get-pr-number | ||
uses: mgaitan/gha-get-pr-number@0.1 | ||
- name: Build base-focal image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
load: true | ||
tags: base-focal:${{ steps.get-pr-number.outputs.number }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile.base-focal | ||
- name: Build base-jammy image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
load: true | ||
tags: base-jammy:${{ steps.get-pr-number.outputs.number }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile.base-jammy | ||
- name: Build standart image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
tags: standart:${{ steps.get-pr-number.outputs.number }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile | ||
build-args: | | ||
BASE_IMAGE_NAME=base-jammy | ||
BASE_IMAGE_TAG=${{ steps.get-pr-number.outputs.number }} | ||
- name: Build gradle 7.3.3 image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
tags: gradle7:${{ steps.get-pr-number.outputs.number }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile.gradle-7.3.3 | ||
build-args: | | ||
BASE_IMAGE_NAME=base-jammy | ||
BASE_IMAGE_TAG=${{ steps.get-pr-number.outputs.number }} | ||
- name: Build gradle 8.1.1 image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
tags: gradle8:${{ steps.get-pr-number.outputs.number }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile.gradle-8.1.1 | ||
build-args: | | ||
BASE_IMAGE_NAME=base-jammy | ||
BASE_IMAGE_TAG=${{ steps.get-pr-number.outputs.number }} | ||
- name: Build .Net 3.1 image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
tags: dotnet3:${{ steps.get-pr-number.outputs.number }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile.dotnet-3.1 | ||
build-args: | | ||
BASE_IMAGE_NAME=base-focal | ||
BASE_IMAGE_TAG=${{ steps.get-pr-number.outputs.number }} | ||
- name: Build .Net 5.0 image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
tags: dotnet5:${{ steps.get-pr-number.outputs.number }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile.dotnet-5.0 | ||
build-args: | | ||
BASE_IMAGE_NAME=base-focal | ||
BASE_IMAGE_TAG=${{ steps.get-pr-number.outputs.number }} | ||
- name: Build .Net 6.0 image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
tags: dotnet6:${{ steps.get-pr-number.outputs.number }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile.dotnet-6.0 | ||
build-args: | | ||
BASE_IMAGE_NAME=base-jammy | ||
BASE_IMAGE_TAG=${{ steps.get-pr-number.outputs.number }} | ||
- name: Build .Net 7.0 image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
push: false | ||
tags: dotnet7:${{ steps.get-pr-number.outputs.number }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: Dockerfile.dotnet-7.0 | ||
build-args: | | ||
BASE_IMAGE_NAME=base-jammy | ||
BASE_IMAGE_TAG=${{ steps.get-pr-number.outputs.number }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
default: true | ||
extends: null | ||
MD001: true | ||
MD003: | ||
style: "consistent" | ||
MD004: | ||
style: "consistent" | ||
MD005: true | ||
MD007: | ||
indent: 2 | ||
start_indented: false | ||
MD009: | ||
br_spaces: 2 | ||
list_item_empty_lines: false | ||
strict: false | ||
MD010: | ||
code_blocks: true | ||
MD011: true | ||
MD012: | ||
maximum: 1 | ||
MD013: | ||
line_length: 80 | ||
heading_line_length: 80 | ||
code_block_line_length: 120 | ||
code_blocks: false | ||
tables: false | ||
headings: true | ||
headers: true | ||
strict: false | ||
stern: false | ||
MD014: true | ||
MD018: true | ||
MD019: true | ||
MD020: true | ||
MD021: true | ||
MD022: | ||
lines_above: 1 | ||
lines_below: 1 | ||
MD023: true | ||
MD024: | ||
allow_different_nesting: false | ||
siblings_only: true | ||
MD026: | ||
punctuation: ".,;:!。,;:!?" | ||
MD027: true | ||
MD028: true | ||
MD029: | ||
style: "one_or_ordered" | ||
MD030: | ||
ul_single: 1 | ||
ol_single: 1 | ||
ul_multi: 1 | ||
ol_multi: 1 | ||
MD031: | ||
list_items: true | ||
MD032: true | ||
MD033: | ||
allowed_elements: [] | ||
MD034: true | ||
MD035: | ||
style: "consistent" | ||
MD036: | ||
punctuation: ".,;:!?。,;:!?" | ||
MD037: true | ||
MD038: true | ||
MD039: true | ||
MD040: true | ||
MD042: true | ||
MD044: | ||
names: [] | ||
code_blocks: true | ||
MD045: true | ||
MD046: | ||
style: "consistent" | ||
MD047: true | ||
MD048: | ||
style: "consistent" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.