-
Notifications
You must be signed in to change notification settings - Fork 245
Add reusable workflow #484
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
BeyondEvil
merged 1 commit into
pytest-dev:master
from
BeyondEvil:add-reusable-workflow
Jan 17, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,132 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
test_python: | ||
name: ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
name: py36-ubuntu | ||
python-version: 3.6 | ||
|
||
- os: windows-latest | ||
name: py36-windows | ||
python-version: 3.6 | ||
|
||
- os: macOS-latest | ||
name: py36-mac | ||
python-version: 3.6 | ||
|
||
- os: ubuntu-latest | ||
name: py37-ubuntu | ||
python-version: 3.7 | ||
|
||
- os: windows-latest | ||
name: py37-windows | ||
python-version: 3.7 | ||
|
||
- os: macOS-latest | ||
name: py37-mac | ||
python-version: 3.7 | ||
|
||
- os: ubuntu-latest | ||
name: py38-ubuntu | ||
python-version: 3.8 | ||
|
||
- os: windows-latest | ||
name: py38-windows | ||
python-version: 3.8 | ||
|
||
- os: macOS-latest | ||
name: py38-mac | ||
python-version: 3.8 | ||
|
||
- os: ubuntu-latest | ||
name: py39-ubuntu | ||
python-version: 3.9 | ||
|
||
- os: windows-latest | ||
name: py39-windows | ||
python-version: 3.9 | ||
|
||
- os: macOS-latest | ||
name: py39-mac | ||
python-version: 3.9 | ||
|
||
- os: ubuntu-latest | ||
name: pypy3-ubuntu | ||
python-version: pypy3 | ||
|
||
- os: windows-latest | ||
name: pypy3-windows | ||
python-version: pypy3 | ||
# https://github.com/pytest-dev/pytest-html/issues/482 | ||
# - os: macOS-latest | ||
# name: pypy3-mac | ||
# python-version: pypy3 | ||
|
||
- os: ubuntu-latest | ||
name: devel-ubuntu | ||
python-version: 3.9 | ||
|
||
steps: | ||
- name: Set Newline Behavior | ||
run : git config --global core.autocrlf false | ||
- uses: actions/checkout@master | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix['python-version'] }} | ||
- name: Install tox | ||
run: python -m pip install --upgrade tox | ||
- name: Get Tox Environment Name From Matrix Name | ||
uses: rishabhgupta/split-by@v1 | ||
id: split-matrix-name | ||
with: | ||
string: '${{ matrix.name }}' | ||
split-by: '-' | ||
- name: Test with tox | ||
run: python -m tox -e ${{ steps.split-matrix-name.outputs._0}}-cov | ||
# TODO: https://github.com/pytest-dev/pytest-html/issues/481 | ||
# - name: Upload coverage to codecov | ||
# if: github.event.schedule == '' | ||
# uses: codecov/codecov-action@v2 | ||
# with: | ||
# fail_ci_if_error: true | ||
# file: ./coverage.xml | ||
# flags: tests | ||
# name: ${{ matrix.py }} - ${{ matrix.os }} | ||
# verbose: true | ||
|
||
test_javascript: | ||
name: grunt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
- name: Install Dependencies | ||
run: npm install | ||
- name: QUnit Tests | ||
run: npm test | ||
|
||
linting: | ||
name: linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install tox | ||
run: python -m pip install --upgrade tox | ||
- name: Lint with tox | ||
run: python -m tox -e linting |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coudl thisone be migrated to precommit.ci?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean @RonnyPfannschmidt ?
It is run by pre-commit: https://github.com/pytest-dev/pytest-html/blob/master/tox.ini#L22
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://pre-commit.ci/
We have been enabling this for many pytest plugins, including pytest itself, and are very happy with the results.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, nice!
I'll follow up this PR with one to migrate it then. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How exactly do I migrate?
According to pre-commit.ci docs - nothing is needed except the config file (which exists) and I couldn't find anything in the pytest repo to hint at how to do it either? @nicoddemus
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think I figured it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to add anything to the repository, we just need to enable it in the project settings. Is that what you did?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, that's what I did. :)