-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from RedHatProductSecurity/add-actions
Add GitHub actions for linting and automated testing
- Loading branch information
Showing
3 changed files
with
53 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Lint | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
merge_group: | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: pip install black==22.12.0 isort==5.12.0 flake8==6.1.0 | ||
- name: Run black | ||
run: black --check . | ||
- name: Run isort | ||
run: isort --diff --check . | ||
- name: Run flake8 | ||
# E203: whitespace before ':', ignored by Black, non-PEP8-compliant | ||
# E501: line too long, black'll take care of that | ||
run: flake8 --max-line-length=88 --extend-ignore=E203,E501 |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Test | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
merge_group: | ||
jobs: | ||
unit: | ||
runs-on: ubuntu-latest | ||
services: | ||
redis: | ||
image: redis | ||
ports: | ||
- 6399:6379 | ||
strategy: | ||
matrix: | ||
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install dependencies | ||
run: pip install -r requirements-testing.txt | ||
- name: Run tests | ||
run: tox |
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