Skip to content

Commit

Permalink
Merge pull request #21 from scality/feature/add-developer-tooling
Browse files Browse the repository at this point in the history
Adding developer tools and checks
  • Loading branch information
tcarmet authored May 8, 2023
2 parents 9512985 + 7cd354e commit 1c15b8f
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 26 deletions.
18 changes: 18 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "Python 3",
"image": "mcr.microsoft.com/devcontainers/python:0-3.10",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/poetry:2": {
"version": "latest"
},
"ghcr.io/trunk-io/devcontainer-feature/trunk:1": {}
},
"customizations": {
"vscode": {
"extensions": ["github.vscode-github-actions"]
}
}
}
47 changes: 21 additions & 26 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
---

name: tests

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Trunk Check
uses: trunk-io/trunk-action@v1
tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: install poetry
run: pip install poetry
- name: Poetry deps cache
uses: actions/cache@v2
with:
path: "~/.cache/pypoetry"
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install
- name: Lint project
run: poetry run flake8
- uses: azure/setup-helm@v1
with:
version: v2.17.0
- run: helm lint ./charts/gh-action-exporter
- name: Run tests
run: poetry run pytest --cov=. --cov-report=xml
- name: Upload test coverage
uses: codecov/codecov-action@v2
if: always()
- uses: actions/checkout@v3
- name: install poetry
run: pip install poetry
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: poetry
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest --cov=. --cov-report=xml
- name: Upload test coverage
uses: codecov/codecov-action@v2
if: always()
8 changes: 8 additions & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*out
*logs
*actions
*notifications
plugins
user_trunk.yaml
user.yaml
shims
4 changes: 4 additions & 0 deletions .trunk/configs/.hadolint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Following source doesn't work in most setups
ignored:
- SC1090
- SC1091
2 changes: 2 additions & 0 deletions .trunk/configs/.isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[settings]
profile=black
10 changes: 10 additions & 0 deletions .trunk/configs/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Autoformatter friendly markdownlint config (all formatting rules disabled)
default: true
blank_lines: false
bullet: false
html: false
indentation: false
line_length: false
spaces: false
url: false
whitespace: false
10 changes: 10 additions & 0 deletions .trunk/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rules:
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
26 changes: 26 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 0.1
cli:
version: 1.9.1
plugins:
sources:
- id: trunk
ref: v0.0.16
uri: https://github.com/trunk-io/plugins
lint:
enabled:
- actionlint@1.6.24
- black@23.3.0
- git-diff-check
- gitleaks@8.16.3
- hadolint@2.12.0
- isort@5.12.0
- markdownlint@0.34.0
- prettier@2.8.8
- ruff@0.0.265
- taplo@0.7.0
- yamllint@1.31.0
runtimes:
enabled:
- go@1.19.5
- node@18.12.1
- python@3.10.8

0 comments on commit 1c15b8f

Please sign in to comment.