-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 How to split long command as multiple lines (cross-SO way) https://stackoverflow.com/a/65808412/6366150
- Loading branch information
Gonzalo Diaz
committed
Jun 9, 2024
1 parent
5044eb2
commit 400c194
Showing
9 changed files
with
176 additions
and
155 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
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 |
---|---|---|
@@ -1,43 +1,50 @@ | ||
--- | ||
name: Docker Image CI | ||
|
||
on: | ||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: [ "main", "develop", "feature/*" ] | ||
branches: ["main", "develop", "feature/*"] | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: ["main"] | ||
|
||
jobs: | ||
|
||
build: | ||
name: "Build & Test in Docker" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
- name: Build the Docker image | ||
run: make compose/rebuild | ||
- name: Run static checks in Docker image | ||
run: make compose/lint | ||
- name: Run test in Docker image | ||
run: make compose/run | ||
- name: Tag Docker image | ||
run: docker tag algorithm-exercises-py:latest algorithm-exercises-py:${{ github.sha }} | ||
|
||
- name: Run Snyk to check Docker image for vulnerabilities | ||
# Snyk can be used to break the build when it detects vulnerabilities. | ||
# In this case we want to upload the issues to GitHub Code Scanning | ||
continue-on-error: true | ||
uses: snyk/actions/docker@master | ||
env: | ||
# In order to use the Snyk Action you will need to have a Snyk API token. | ||
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token | ||
# or you can sign up for free at https://snyk.io/login | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
image: algorithm-exercises-py:latest | ||
args: --file=Dockerfile | ||
# - name: Upload result to GitHub Code Scanning | ||
# uses: github/codeql-action/upload-sarif@v2 | ||
# with: | ||
# sarif_file: snyk.sarif | ||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
- name: Build the Docker image | ||
run: make compose/rebuild | ||
- name: Run static checks in Docker image | ||
run: make compose/lint | ||
- name: Run test in Docker image | ||
run: make compose/run | ||
- name: Tag Docker image | ||
run: > | ||
docker tag | ||
algorithm-exercises-py:latest | ||
algorithm-exercises-py:${{ github.sha }} | ||
- name: Run Snyk to check Docker image for vulnerabilities | ||
# Snyk can be used to break the build when it detects vulnerabilities. | ||
# In this case we want to upload the issues to GitHub Code Scanning | ||
continue-on-error: true | ||
uses: snyk/actions/docker@master | ||
env: | ||
# yamllint disable rule:line-length | ||
# In order to use the Snyk Action you will need to have | ||
# a Snyk API token. | ||
# See https://docs.snyk.io/integrations/ci-cd-integrations/github-actions-integration#getting-your-snyk-token | ||
# or you can sign up for free at https://snyk.io/login | ||
# yamllint enable rule:line-length | ||
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} | ||
with: | ||
image: algorithm-exercises-py:latest | ||
args: --file=Dockerfile | ||
# yamllint disable rule:comments-indentation | ||
# - name: Upload result to GitHub Code Scanning | ||
# uses: github/codeql-action/upload-sarif@v2 | ||
# with: | ||
# sarif_file: snyk.sarif | ||
# yamllint enable rule:comments-indentation |
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 |
---|---|---|
@@ -1,37 +1,39 @@ | ||
--- | ||
name: Markdown Lint | ||
|
||
on: | ||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: [ "main", "develop", "feature/*" ] | ||
branches: ["main", "develop", "feature/*"] | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: ["main"] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
node-version: [20.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
# See supported Node.js release | ||
# schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
|
||
- name: Set up Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Checkout repository | ||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
|
||
- name: Install dependencies | ||
run: npm install -g markdownlint-cli | ||
- name: Set up Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Version | ||
run: markdownlint --version | ||
- name: Install dependencies | ||
run: npm install -g markdownlint-cli | ||
|
||
- name: Lint | ||
run: markdownlint '**/*.md' --ignore node_modules && echo '✔ Your code looks good.' | ||
- name: Version | ||
run: markdownlint --version | ||
|
||
- name: Lint | ||
run: > | ||
markdownlint '**/*.md' --ignore node_modules | ||
&& echo '✔ Your code looks good.' |
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 |
---|---|---|
@@ -1,62 +1,67 @@ | ||
--- | ||
name: Python CI Coverage | ||
|
||
on: | ||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: [ "main", "develop", "feature/*" ] | ||
branches: ["main", "develop", "feature/*"] | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: ["main"] | ||
|
||
env: | ||
LOG_LEVEL: INFO | ||
|
||
jobs: | ||
|
||
build: | ||
name: "Run CI" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
python: ['3.12'] | ||
python: ["3.12"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@master | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install | ||
run: | | ||
pip3 install -r requirements.txt | ||
- name: Test an coverage collect | ||
run: | | ||
python3 -m coverage run -m pytest --verbose -o log_cli=true --log-cli-level=INFO src/ | ||
- name: Coverage Report | ||
run: | | ||
python3 -m coverage report | ||
- name: Coverage lcov | ||
run: | | ||
python3 -m coverage lcov -o coverage/lcov.info | ||
- name: Upload coverage reports to Codecov with GitHub Action | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} # required | ||
verbose: true # optional (default = false) | ||
|
||
- name: Coverage XML | ||
run: | | ||
python3 -m coverage xml | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 | ||
with: | ||
# Shallow clones should be disabled for a better relevancy of analysis | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@master | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install | ||
run: | | ||
pip3 install -r requirements.txt | ||
- name: Test an coverage collect | ||
run: > | ||
python3 -m coverage run -m pytest --verbose | ||
-o log_cli=true | ||
--log-cli-level=INFO | ||
src/ | ||
- name: Coverage Report | ||
run: | | ||
python3 -m coverage report | ||
- name: Coverage lcov | ||
run: | | ||
python3 -m coverage lcov -o coverage/lcov.info | ||
- name: Upload coverage reports to Codecov with GitHub Action | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} # required | ||
verbose: true # optional (default = false) | ||
|
||
- name: Coverage XML | ||
run: | | ||
python3 -m coverage xml | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
# Needed to get PR information, if any | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.