Skip to content

Commit c904381

Browse files
authored
Merge pull request #181 from sir-gon/feature/yamllint
Feature/yamllint
2 parents bde351f + 156c772 commit c904381

15 files changed

+303
-136
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# package ecosystems to update and where the package manifests are located.
33
# Please see the documentation for all configuration options:
44
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
---
56

67
version: 2
78
updates:

.github/workflows/codeql.yml

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,28 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12+
---
13+
1214
name: CodeQL
1315

1416
permissions: read-all
1517

16-
on:
18+
on: # yamllint disable-line rule:truthy
1719
push:
18-
branches: [ main, develop, feature/* ]
20+
branches: ["main", "develop", "feature/*"]
1921
pull_request:
2022
# The branches below must be a subset of the branches above
21-
branches: [ main ]
23+
branches: ["main"]
2224
schedule:
25+
# ┌───────────── minute (0 - 59)
26+
# │ ┌───────────── hour (0 - 23)
27+
# │ │ ┌───────────── day of the month (1 - 31)
28+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
29+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
30+
# │ │ │ │ │
31+
# │ │ │ │ │
32+
# │ │ │ │ │
33+
# * * * * *
2334
- cron: 26 23 * * 3
2435

2536
jobs:
@@ -34,55 +45,60 @@ jobs:
3445
strategy:
3546
fail-fast: false
3647
matrix:
37-
language: [ java ]
48+
language: [java]
49+
# yamllint disable rule:line-length
3850
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
3951
# Use only 'java' to analyze code written in Java, Kotlin or both
4052
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
4153
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
42-
54+
# yamllint enable rule:line-length
4355
steps:
44-
- name: Checkout repository
45-
uses: actions/checkout@v4
56+
- name: Checkout repository
57+
uses: actions/checkout@v4
4658

47-
- name: Set up JDK 20
48-
uses: actions/setup-java@v4
49-
with:
50-
java-version: '20'
51-
distribution: temurin
59+
- name: Set up JDK 20
60+
uses: actions/setup-java@v4
61+
with:
62+
java-version: '20'
63+
distribution: temurin
5264

53-
# Initializes the CodeQL tools for scanning.
54-
- name: Initialize CodeQL
55-
uses: github/codeql-action/init@v3
56-
with:
57-
languages: ${{ matrix.language }}
58-
# If you wish to specify custom queries, you can do so here or in a config file.
59-
# By default, queries listed here will override any specified in a config file.
60-
# Prefix the list here with + to use these queries and those in the config file.
65+
# Initializes the CodeQL tools for scanning.
66+
- name: Initialize CodeQL
67+
uses: github/codeql-action/init@v3
68+
with:
69+
languages: ${{ matrix.language }}
70+
# yamllint disable rule:line-length
6171

62-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
63-
# queries: security-extended,security-and-quality
72+
# If you wish to specify custom queries, you can do so here or in a config file.
73+
# By default, queries listed here will override any specified in a config file.
74+
# Prefix the list here with + to use these queries and those in the config file.
6475

76+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
77+
# queries: security-extended,security-and-quality
78+
# yamllint enable rule:line-length
6579

66-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
67-
# If this step fails, then you should remove it and run the build manually (see below)
68-
# - name: Autobuild
69-
# uses: github/codeql-action/autobuild@v2
80+
# yamllint disable rule:line-length
81+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
82+
# If this step fails, then you should remove it and run the build manually (see below)
83+
# - name: Autobuild
84+
# uses: github/codeql-action/autobuild@v2
7085

71-
# ℹ️ Command-line programs to run using the OS shell.
72-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
86+
# ℹ️ Command-line programs to run using the OS shell.
87+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
7388

74-
# If the Autobuild fails above, remove it and uncomment the following three lines.
75-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
89+
# If the Autobuild fails above, remove it and uncomment the following three lines.
90+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
91+
# yamllint enable rule:line-length
7692

77-
- run: |
78-
echo Run, Build Application using script
79-
./gradlew build
93+
- run: |
94+
echo Run, Build Application using script
95+
./gradlew build
8096
81-
# - run: |
82-
# echo Run, Build Application using script
83-
# ./location_of_script_within_repo/buildscript.sh
97+
# - run: |
98+
# echo Run, Build Application using script
99+
# ./location_of_script_within_repo/buildscript.sh
84100

85-
- name: Perform CodeQL Analysis
86-
uses: github/codeql-action/analyze@v3
87-
with:
88-
category: /language:${{matrix.language}}
101+
- name: Perform CodeQL Analysis
102+
uses: github/codeql-action/analyze@v3
103+
with:
104+
category: /language:${{matrix.language}}

.github/workflows/docker-image.yml

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
name: Docker Image CI
1+
---
22

3+
name: Docker Image CI
34

4-
on:
5+
on: # yamllint disable-line rule:truthy
56
push:
6-
branches: [ main, develop, feature/* ]
7+
branches: ["main", "develop", "feature/*"]
78
pull_request:
8-
branches: [ main ]
9+
branches: ["main"]
910

1011
permissions: read-all
1112

@@ -17,28 +18,35 @@ jobs:
1718
runs-on: ubuntu-latest
1819

1920
steps:
20-
- uses: actions/checkout@v4
21-
- name: Build the Docker image
22-
run: make compose/rebuild
23-
- name: Run test in Docker image
24-
run: make compose/run
25-
- name: Tag Docker image
26-
run: docker tag algorithm-exercises-java:latest algorithm-exercises-java:${{ github.sha }}
27-
28-
- name: Run Snyk to check Docker image for vulnerabilities
29-
# Snyk can be used to break the build when it detects vulnerabilities.
30-
# In this case we want to upload the issues to GitHub Code Scanning
31-
continue-on-error: true
32-
uses: snyk/actions/docker@master
33-
env:
34-
# In order to use the Snyk Action you will need to have a Snyk API token.
35-
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
36-
# or you can sign up for free at https://snyk.io/login
37-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
38-
with:
39-
image: algorithm-exercises-java:latest
40-
args: --file=Dockerfile
41-
# - name: Upload result to GitHub Code Scanning
42-
# uses: github/codeql-action/upload-sarif@v2
43-
# with:
44-
# sarif_file: snyk.sarif
21+
- uses: actions/checkout@v4
22+
- name: Build the Docker image
23+
run: make compose/rebuild
24+
- name: Run test in Docker image
25+
run: make compose/run
26+
- name: Tag Docker image
27+
run: >
28+
docker tag
29+
algorithm-exercises-java:latest
30+
algorithm-exercises-java:${{ github.sha }}
31+
32+
- name: Run Snyk to check Docker image for vulnerabilities
33+
# Snyk can be used to break the build when it detects vulnerabilities.
34+
# In this case we want to upload the issues to GitHub Code Scanning
35+
continue-on-error: true
36+
uses: snyk/actions/docker@master
37+
env:
38+
# yamllint disable rule:line-length
39+
# In order to use the Snyk Action you will need to have a Snyk API token.
40+
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
41+
# or you can sign up for free at https://snyk.io/login
42+
# yamllint enable rule:line-length
43+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
44+
with:
45+
image: algorithm-exercises-java:latest
46+
args: --file=Dockerfile
47+
# yamllint disable rule:comments-indentation
48+
# - name: Upload result to GitHub Code Scanning
49+
# uses: github/codeql-action/upload-sarif@v2
50+
# with:
51+
# sarif_file: snyk.sarif
52+
# yamllint enable rule:comments-indentation

.github/workflows/gitleaks.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
---
2+
13
name: gitleaks
2-
on:
4+
5+
on: # yamllint disable-line rule:truthy
36
pull_request:
47
push:
58
workflow_dispatch:
@@ -16,4 +19,5 @@ jobs:
1619
- uses: gitleaks/gitleaks-action@v2
1720
env:
1821
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}} # Only required for Organizations, not personal accounts.
22+
# Only required for Organizations, not personal accounts.
23+
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}

.github/workflows/java-gradle-coverage.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
1+
# yamllint disable rule:line-length
12
# This workflow uses actions that are not certified by GitHub.
23
# They are provided by a third-party and are governed by
34
# separate terms of service, privacy policy, and support
45
# documentation.
56
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
67
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
8+
# yamllint enable rule:line-length
9+
---
710

811
name: Java CI Coverage with Gradle
912

10-
on:
13+
on: # yamllint disable-line rule:truthy
1114
push:
12-
branches: [ main, develop, feature/* ]
15+
branches: ["main", "develop", "feature/*"]
1316
pull_request:
14-
branches: [ main ]
17+
branches: ["main"]
1518

1619
permissions:
1720
contents: read
1821

1922
jobs:
20-
gradle:
21-
22-
strategy:
23-
matrix:
24-
os: [ubuntu-latest]
25-
runs-on: ${{ matrix.os }}
23+
coverage:
24+
runs-on: ubuntu-latest
2625

2726
steps:
2827
- uses: actions/checkout@v4
2928
- name: Set up JDK
3029
uses: actions/setup-java@v4
3130
with:
32-
java-version: '21'
31+
java-version: 21
32+
# Alternative distribution options are available
3333
distribution: temurin
34-
3534
- name: Validate Gradle wrapper
3635
uses: gradle/actions/wrapper-validation@v3
3736

.github/workflows/java-gradle.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1+
# yamllint disable rule:line-length
12
# This workflow uses actions that are not certified by GitHub.
23
# They are provided by a third-party and are governed by
34
# separate terms of service, privacy policy, and support
45
# documentation.
56
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
67
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
8+
# yamllint enable rule:line-length
9+
---
710

811
name: Java CI Tests with Gradle
912

10-
on:
13+
on: # yamllint disable-line rule:truthy
1114
push:
12-
branches: [ main, develop, feature/* ]
15+
branches: ["main", "develop", "feature/*"]
1316
pull_request:
14-
branches: [ main ]
17+
branches: ["main"]
1518

1619
permissions:
1720
contents: read
1821

1922
jobs:
2023
gradle:
21-
2224
strategy:
2325
matrix:
2426
os: [ubuntu-latest, macos-latest, windows-latest]
25-
java: [ '20', '21' ]
27+
java: ['20', '21']
2628
runs-on: ${{ matrix.os }}
2729

2830
steps:

.github/workflows/markdown-lint.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1+
---
12
name: Markdown Lint
23

3-
on:
4+
on: # yamllint disable-line rule:truthy
45
push:
5-
branches: [ main, develop, feature/* ]
6+
branches: ["main", "develop", "feature/*"]
67
pull_request:
7-
branches: [ main ]
8+
branches: ["main"]
89

910
permissions: read-all
1011

1112
jobs:
1213
build:
13-
1414
runs-on: ubuntu-latest
1515

1616
strategy:
1717
matrix:
18-
os: [ubuntu-latest]
1918
node-version: [20.x]
20-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19+
# See supported Node.js release schedule
20+
# at https://nodejs.org/en/about/releases/
2121

2222
steps:
23-
- name: Checkout repository
24-
uses: actions/checkout@v4
25-
26-
- name: Set up Node.js ${{ matrix.node-version }}
27-
uses: actions/setup-node@v4
28-
with:
29-
node-version: ${{ matrix.node-version }}
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
3025

31-
- name: Install dependencies
32-
run: npm install -g markdownlint-cli
26+
- name: Set up Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node-version }}
3330

34-
- name: Lint
35-
run: markdownlint '**/*.md' --ignore node_modules && echo '✔ Your code looks good.'
31+
- name: Install dependencies
32+
run: npm install -g markdownlint-cli
3633

34+
- name: Lint
35+
run: >
36+
markdownlint '**/*.md' --ignore node_modules
37+
&& echo '✔ Your code looks good.'

0 commit comments

Comments
 (0)