Skip to content

Commit 5542b7a

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [FIX] yamllint warnings and errors fixed.
False positive in "on:" adrienverge/yamllint#430 (comment) Can't use "%YAML 1.2" directive because brakes Github Actions
1 parent 4644678 commit 5542b7a

File tree

9 files changed

+176
-151
lines changed

9 files changed

+176
-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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
---
12
name: "CodeQL"
23

34
on:
45
push:
5-
branches: [ "main", "develop", "feature/*" ]
6+
branches: ["main", "develop", "feature/*"]
67
pull_request:
7-
branches: [ "main" ]
8+
branches: ["main"]
89
schedule:
910
- cron: "52 12 * * 1"
1011

@@ -20,11 +21,11 @@ jobs:
2021
strategy:
2122
fail-fast: false
2223
matrix:
23-
language: [ python ]
24+
language: [python]
2425

2526
steps:
2627
- name: Checkout
27-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
28+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
2829

2930
- name: Initialize CodeQL
3031
uses: github/codeql-action/init@v3

.github/workflows/docker-image.yml

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
1+
---
12
name: Docker Image CI
23

34
on:
45
push:
5-
branches: [ "main", "develop", "feature/*" ]
6+
branches: ["main", "develop", "feature/*"]
67
pull_request:
7-
branches: [ "main" ]
8+
branches: ["main"]
89

910
jobs:
10-
1111
build:
1212
name: "Build & Test in Docker"
1313

1414
runs-on: ubuntu-latest
1515

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

.github/workflows/gitleaks.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
---
2+
13
name: gitleaks
4+
25
on:
36
pull_request:
47
push:
58
workflow_dispatch:
69
schedule:
7-
- cron: "0 4 * * *" # run once a day at 4 AM
10+
- cron: "0 4 * * *" # run once a day at 4 AM
811
jobs:
912
scan:
1013
name: gitleaks
@@ -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 accosunts.
23+
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}

.github/workflows/markdown-lint.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
1+
---
2+
13
name: Markdown Lint
24

35
on:
46
push:
5-
branches: [ "main", "develop", "feature/*" ]
7+
branches: ["main", "develop", "feature/*"]
68
pull_request:
7-
branches: [ "main" ]
9+
branches: ["main"]
810

911
jobs:
1012
build:
11-
1213
runs-on: ubuntu-latest
1314

1415
strategy:
1516
matrix:
1617
os: ["ubuntu-latest"]
1718
node-version: [20.x]
18-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19+
# See supported Node.js release
20+
# schedule at https://nodejs.org/en/about/releases/
1921

2022
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 }}
23+
- name: Checkout repository
24+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
2825

29-
- name: Install dependencies
30-
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 }}
3130

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

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

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

.github/workflows/python-coverage.yml

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,68 @@
1+
---
2+
13
name: Python CI Coverage
24

35
on:
46
push:
5-
branches: [ "main", "develop", "feature/*" ]
7+
branches: ["main", "develop", "feature/*"]
68
pull_request:
7-
branches: [ "main" ]
9+
branches: ["main"]
810

911
env:
1012
LOG_LEVEL: INFO
1113

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

0 commit comments

Comments
 (0)