Skip to content

Commit 4d1850c

Browse files
authored
Merge pull request #490 from sir-gon/develop
Develop
2 parents 481070c + 16afc2a commit 4d1850c

13 files changed

+224
-156
lines changed

.editorconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@ root = true
2424

2525
[*]
2626
indent_style = space
27-
indent_size = 4
27+
indent_size = 2
2828
end_of_line = lf
2929
charset = utf-8
3030
trim_trailing_whitespace = true
3131
insert_final_newline = true
3232

33+
[**.py]
34+
indent_style = space
35+
indent_size = 4
36+
3337
[{Makefile,**.mk}]
3438
# Use tabs for indentation (Makefiles require tabs)
3539
indent_style = tab

.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

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
schedule:
910
- cron: "52 12 * * 1"
1011

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

2526
steps:
2627
- name: Checkout

.github/workflows/docker-image.yml

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,50 @@
1+
---
12
name: Docker Image CI
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
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: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
---
12
name: gitleaks
2-
on:
3+
4+
on: # yamllint disable-line rule:truthy
35
pull_request:
46
push:
57
workflow_dispatch:
@@ -16,4 +18,5 @@ jobs:
1618
- uses: gitleaks/gitleaks-action@v2
1719
env:
1820
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}} # Only required for Organizations, not personal accounts.
21+
# Only required for Organizations, not personal accosunts.
22+
# GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE}}

.github/workflows/markdown-lint.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
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
jobs:
1011
build:
11-
1212
runs-on: ubuntu-latest
1313

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

2021
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 }}
22+
- name: Checkout repository
23+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
2824

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

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

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

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

.github/workflows/python-coverage.yml

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,67 @@
1+
---
12
name: Python CI Coverage
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
env:
1011
LOG_LEVEL: INFO
1112

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

0 commit comments

Comments
 (0)