-
Notifications
You must be signed in to change notification settings - Fork 951
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d57922b
commit 5dc9493
Showing
2 changed files
with
90 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- master | ||
- dev_* | ||
tags: | ||
- v* | ||
pull_request: | ||
|
@@ -15,85 +15,118 @@ on: | |
- cron: '10 2 * * 0' | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
linters: | ||
name: Linters - ${{ matrix.os.on }} - ${{ matrix.python.version }} | ||
runs-on: ${{ matrix.os.on }} | ||
timeout-minutes: 10 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- on: ubuntu-latest | ||
# - on: macos-latest | ||
# - on: windows-latest | ||
python: | ||
- version: '3.8' | ||
- version: '3.9' | ||
- version: '3.10' | ||
- version: '3.11' | ||
- version: '3.12' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python.version }} | ||
cache: 'pip' | ||
- run: pip install -e ".[all]" | ||
- run: codespell | ||
- run: pylint --recursive=y examples pymodbus test | ||
- run: pre-commit run --all-files | ||
- run: cd doc; ./build_html | ||
- run: mypy pymodbus | ||
|
||
integreation_test: | ||
name: pytest - ${{ matrix.os.on }} - ${{ matrix.python.version }} | ||
runs-on: ${{ matrix.os.on }} | ||
testing: | ||
name: ${{ matrix.os }} - ${{ matrix.python }} | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- on: ubuntu-latest | ||
- on: macos-latest | ||
- on: windows-latest | ||
python: | ||
- version: '3.8' | ||
- version: '3.9' | ||
- version: '3.10' | ||
- version: '3.11' | ||
- version: '3.12' | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
include: | ||
- python: '3.8' | ||
run_lint: true | ||
- python: '3.12' | ||
run_doc: true | ||
run_lint: true | ||
- os: macos-latest | ||
run_doc: false | ||
run_lint: false | ||
- os: windows-latest | ||
run_doc: false | ||
run_lint: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
- name: Checkout repo from github | ||
uses: actions/[email protected] | ||
|
||
- name: Set up Python ${{ matrix.python }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python.version }} | ||
cache: 'pip' | ||
- run: pip install -e ".[all]" | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Set venv path (NON Windows) | ||
if: matrix.os != 'windows-latest' | ||
run: | | ||
echo "VIRTUAL_ENV=${{ github.workspace }}/venv" >> $GITHUB_ENV | ||
echo ${{ github.workspace }}/venv/bin >> $GITHUB_PATH | ||
- run: pytest -n0 -v --full-trace --timeout=1200 | ||
- name: Set venv path (Windows) | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
echo "VIRTUAL_ENV=${{ github.workspace }}\\venv" >> $Env:GITHUB_ENV | ||
echo "${{ github.workspace }}\\venv\\Scripts" >> $Env:GITHUB_PATH | ||
- name: Restore base Python virtual environment | ||
id: cache-venv | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ env.VIRTUAL_ENV }} | ||
key: >- | ||
${{ runner.os }}-${{ matrix.python }}-venv-${{ | ||
hashFiles('pyproject.toml') }}-${{ | ||
hashFiles('.pre-commit-config.yaml') }} | ||
- name: Create venv (NEW CACHE) | ||
if: steps.cache-venv.outputs.cache-hit != 'true' | ||
run: | | ||
python -m venv ${{ env.VIRTUAL_ENV }} | ||
python -m pip install --upgrade pip | ||
pip install -e ".[all]" | ||
- name: codespell | ||
if: matrix.run_doc == true | ||
run: | | ||
codespell | ||
- name: dcoumentation | ||
if: matrix.run_doc == true | ||
run: | | ||
cd doc; ./build_html | ||
- name: pylint | ||
if: matrix.run_lint == true | ||
run: | | ||
pylint --recursive=y examples pymodbus test | ||
- name: mypy | ||
if: matrix.run_lint == true | ||
run: | | ||
mypy pymodbus | ||
- name: precommit | ||
if: matrix.run_lint == true | ||
run: | | ||
pre-commit run --all-files | ||
- name: pytest | ||
run: | | ||
env | ||
pytest -v --full-trace --timeout=1200 | ||
analyze: | ||
name: Analyze Python | ||
runs-on: ubuntu-22.04 | ||
|
||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: github/codeql-action/init@v2 | ||
with: | ||
languages: python | ||
|
||
- uses: github/codeql-action/autobuild@v2 | ||
|
||
- uses: github/codeql-action/analyze@v2 | ||
|
||
ci_complete: | ||
name: ci_complete | ||
runs-on: ubuntu-latest | ||
needs: | ||
- linters | ||
- analyze | ||
- integreation_test | ||
- testing | ||
timeout-minutes: 1 | ||
steps: | ||
- name: Dummy | ||
run: ls | ||
- run: echo 'finish job' |
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