Skip to content

Add template workflow to run integration tests on Go projects #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python/.flake8
# See: https://flake8.pycqa.org/en/latest/user/configuration.html
# The code style defined in this file is the official standardized style to be used in all Arduino tooling projects and
# should not be modified.

[flake8]
doctests = True
# W503 and W504 are mutually exclusive. PEP 8 recommends line break before.
ignore = W503
max-complexity = 10
max-line-length = 120
select = E,W,F,C,N
79 changes: 79 additions & 0 deletions .github/workflows/check-python-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-python-task.md
name: Check Python

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-python-task.ya?ml"
- "**/.flake8"
- "**/poetry.lock"
- "**/pyproject.toml"
- "**/setup.cfg"
- "Taskfile.ya?ml"
- "**/tox.ini"
- "**.py"
pull_request:
paths:
- ".github/workflows/check-python-task.ya?ml"
- "**/.flake8"
- "**/poetry.lock"
- "**/pyproject.toml"
- "**/setup.cfg"
- "Taskfile.ya?ml"
- "**/tox.ini"
- "**.py"
workflow_dispatch:
repository_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install Poetry
run: pip install poetry

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Run flake8
run: task python:lint

formatting:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install Poetry
run: pip install poetry

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Format Python code
run: task python:format

- name: Check formatting
run: git diff --color --exit-code
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
[![Sync Labels status](https://github.com/arduino/tooling-project-assets/actions/workflows/sync-labels.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/sync-labels.yml)
[![Check Workflows status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-workflows-task.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-workflows-task.yml)
[![Spell Check status](https://github.com/arduino/tooling-project-assets/actions/workflows/spell-check-task.yml/badge.svg)](https:/github.com/arduino/tooling-project-assets/actions/workflows/spell-check-task.yml)
[![Check Python status](https://github.com/arduino/tooling-project-assets/actions/workflows/check-python-task.yml/badge.svg)](https://github.com/arduino/tooling-project-assets/actions/workflows/check-python-task.yml)

The [Arduino](https://www.arduino.cc/) Tooling Team's collection of reusable project infrastructure assets.

Expand Down
16 changes: 16 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,22 @@ tasks:
cmds:
- poetry update

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
python:lint:
desc: Lint Python code
deps:
- task: poetry:install-deps
cmds:
- poetry run flake8 --show-source

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml
python:format:
desc: Format Python files
deps:
- task: poetry:install-deps
cmds:
- poetry run black .

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml
yaml:lint:
desc: Check for problems with YAML files
Expand Down
225 changes: 224 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading