Skip to content

Commit 0dd9589

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [FIX] yamllint warnings and errors fixed.
False positive in "on:" adrienverge/yamllint#430 (comment)
1 parent a450271 commit 0dd9589

File tree

9 files changed

+184
-151
lines changed

9 files changed

+184
-151
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: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
%YAML 1.2
2+
---
3+
14
name: "CodeQL"
25

36
on:
47
push:
5-
branches: [ "main", "develop", "feature/*" ]
8+
branches: ["main", "develop", "feature/*"]
69
pull_request:
7-
branches: [ "main" ]
10+
branches: ["main"]
811
schedule:
912
- cron: "52 12 * * 1"
1013

@@ -20,11 +23,11 @@ jobs:
2023
strategy:
2124
fail-fast: false
2225
matrix:
23-
language: [ python ]
26+
language: [python]
2427

2528
steps:
2629
- name: Checkout
27-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
30+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
2831

2932
- name: Initialize CodeQL
3033
uses: github/codeql-action/init@v3

.github/workflows/docker-image.yml

Lines changed: 39 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,52 @@
1+
%YAML 1.2
2+
---
3+
14
name: Docker Image CI
25

36
on:
47
push:
5-
branches: [ "main", "develop", "feature/*" ]
8+
branches: ["main", "develop", "feature/*"]
69
pull_request:
7-
branches: [ "main" ]
10+
branches: ["main"]
811

912
jobs:
10-
1113
build:
1214
name: "Build & Test in Docker"
1315

1416
runs-on: ubuntu-latest
1517

1618
steps:
17-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
18-
- name: Build the Docker image
19-
run: make compose/rebuild
20-
- name: Run static checks in Docker image
21-
run: make compose/lint
22-
- name: Run test in Docker image
23-
run: make compose/run
24-
- name: Tag Docker image
25-
run: docker tag algorithm-exercises-py:latest algorithm-exercises-py:${{ github.sha }}
26-
27-
- name: Run Snyk to check Docker image for vulnerabilities
28-
# Snyk can be used to break the build when it detects vulnerabilities.
29-
# In this case we want to upload the issues to GitHub Code Scanning
30-
continue-on-error: true
31-
uses: snyk/actions/docker@master
32-
env:
33-
# In order to use the Snyk Action you will need to have a Snyk API token.
34-
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token
35-
# or you can sign up for free at https://snyk.io/login
36-
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
37-
with:
38-
image: algorithm-exercises-py:latest
39-
args: --file=Dockerfile
40-
# - name: Upload result to GitHub Code Scanning
41-
# uses: github/codeql-action/upload-sarif@v2
42-
# with:
43-
# sarif_file: snyk.sarif
19+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
20+
- name: Build the Docker image
21+
run: make compose/rebuild
22+
- name: Run static checks in Docker image
23+
run: make compose/lint
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-py:latest
30+
algorithm-exercises-py:${{ github.sha }}
31+
- name: Run Snyk to check Docker image for vulnerabilities
32+
# Snyk can be used to break the build when it detects vulnerabilities.
33+
# In this case we want to upload the issues to GitHub Code Scanning
34+
continue-on-error: true
35+
uses: snyk/actions/docker@master
36+
env:
37+
# yamllint disable rule:line-length
38+
# In order to use the Snyk Action you will need to have
39+
# 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-py: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: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
%YAML 1.2
2+
---
3+
14
name: gitleaks
5+
26
on:
37
pull_request:
48
push:
59
workflow_dispatch:
610
schedule:
7-
- cron: "0 4 * * *" # run once a day at 4 AM
11+
- cron: "0 4 * * *" # run once a day at 4 AM
812
jobs:
913
scan:
1014
name: gitleaks
@@ -16,4 +20,5 @@ jobs:
1620
- uses: gitleaks/gitleaks-action@v2
1721
env:
1822
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}} # Only required for Organizations, not personal accounts.
23+
# Only required for Organizations, not personal accosunts.
24+
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}

.github/workflows/markdown-lint.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,41 @@
1+
%YAML 1.2
2+
---
3+
14
name: Markdown Lint
25

36
on:
47
push:
5-
branches: [ "main", "develop", "feature/*" ]
8+
branches: ["main", "develop", "feature/*"]
69
pull_request:
7-
branches: [ "main" ]
10+
branches: ["main"]
811

912
jobs:
1013
build:
11-
1214
runs-on: ubuntu-latest
1315

1416
strategy:
1517
matrix:
1618
os: ["ubuntu-latest"]
1719
node-version: [20.x]
18-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
# See supported Node.js release
21+
# schedule at https://nodejs.org/en/about/releases/
1922

2023
steps:
21-
- name: Checkout repository
22-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
23-
24-
- name: Set up Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: ${{ matrix.node-version }}
24+
- name: Checkout repository
25+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
2826

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

32-
- name: Version
33-
run: markdownlint --version
32+
- name: Install dependencies
33+
run: npm install -g markdownlint-cli
3434

35-
- name: Lint
36-
run: markdownlint '**/*.md' --ignore node_modules && echo '✔ Your code looks good.'
35+
- name: Version
36+
run: markdownlint --version
3737

38+
- name: Lint
39+
run: |
40+
markdownlint '**/*.md' --ignore node_modules \
41+
&& echo '✔ Your code looks good.'

.github/workflows/python-coverage.yml

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,69 @@
1+
%YAML 1.2
2+
---
3+
14
name: Python CI Coverage
25

36
on:
47
push:
5-
branches: [ "main", "develop", "feature/*" ]
8+
branches: ["main", "develop", "feature/*"]
69
pull_request:
7-
branches: [ "main" ]
10+
branches: ["main"]
811

912
env:
1013
LOG_LEVEL: INFO
1114

1215
jobs:
13-
1416
build:
1517
name: "Run CI"
1618
strategy:
1719
fail-fast: false
1820
matrix:
1921
os: ["ubuntu-latest"]
20-
python: ['3.12']
22+
python: ["3.12"]
2123
runs-on: ${{ matrix.os }}
2224
steps:
23-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
24-
with:
25-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
26-
27-
- name: Setup Python
28-
uses: actions/setup-python@master
29-
with:
30-
python-version: ${{ matrix.python }}
31-
32-
- name: Install
33-
run: |
34-
pip3 install -r requirements.txt
35-
36-
- name: Test an coverage collect
37-
run: |
38-
python3 -m coverage run -m pytest --verbose -o log_cli=true --log-cli-level=INFO src/
39-
40-
- name: Coverage Report
41-
run: |
42-
python3 -m coverage report
43-
44-
- name: Coverage lcov
45-
run: |
46-
python3 -m coverage lcov -o coverage/lcov.info
47-
48-
- name: Upload coverage reports to Codecov with GitHub Action
49-
uses: codecov/codecov-action@v4
50-
with:
51-
token: ${{ secrets.CODECOV_TOKEN }} # required
52-
verbose: true # optional (default = false)
53-
54-
- name: Coverage XML
55-
run: |
56-
python3 -m coverage xml
57-
58-
- name: SonarCloud Scan
59-
uses: SonarSource/sonarcloud-github-action@master
60-
env:
61-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
62-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
25+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
26+
with:
27+
# Shallow clones should be disabled for a better relevancy of analysis
28+
fetch-depth: 0
29+
30+
- name: Setup Python
31+
uses: actions/setup-python@master
32+
with:
33+
python-version: ${{ matrix.python }}
34+
35+
- name: Install
36+
run: |
37+
pip3 install -r requirements.txt
38+
39+
- name: Test an coverage collect
40+
run: |
41+
python3 -m coverage run -m pytest --verbose \
42+
-o log_cli=true \
43+
--log-cli-level=INFO \
44+
src/
45+
46+
- name: Coverage Report
47+
run: |
48+
python3 -m coverage report
49+
50+
- name: Coverage lcov
51+
run: |
52+
python3 -m coverage lcov -o coverage/lcov.info
53+
54+
- name: Upload coverage reports to Codecov with GitHub Action
55+
uses: codecov/codecov-action@v4
56+
with:
57+
token: ${{ secrets.CODECOV_TOKEN }} # required
58+
verbose: true # optional (default = false)
59+
60+
- name: Coverage XML
61+
run: |
62+
python3 -m coverage xml
63+
64+
- name: SonarCloud Scan
65+
uses: SonarSource/sonarcloud-github-action@master
66+
env:
67+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
68+
# Needed to get PR information, if any
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)