-
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 #6 from Kitware/configure-ci
Configure ci and tests and fix formats
- Loading branch information
Showing
21 changed files
with
11,508 additions
and
23,592 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,2 +1,2 @@ | ||
[codespell] | ||
skip = trame_gwc/module/serve/** | ||
skip = **/package-lock.json |
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,9 @@ | ||
[flake8] | ||
|
||
# Just assume black did a good job with the line lengths | ||
ignore = | ||
E501 | ||
|
||
per-file-ignores = | ||
# These directories will always contain "from ... import *" | ||
trame/*:F401,F403 |
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,137 @@ | ||
name: Test and Release | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.10" | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" | ||
|
||
- name: Install Node.js dependencies | ||
run: npm install | ||
working-directory: ./vue-components | ||
|
||
# Install and run pre-commit | ||
- run: | | ||
pip install pre-commit | ||
pre-commit install | ||
pre-commit run --all-files | ||
pytest: | ||
name: Pytest ${{ matrix.config.name }} | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10"] | ||
config: | ||
- { | ||
name: "Linux", | ||
os: ubuntu-latest | ||
} | ||
- { | ||
name: "MacOSX", | ||
os: macos-latest | ||
} | ||
- { | ||
name: "Windows", | ||
os: windows-latest | ||
} | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install and Run Tests | ||
run: | | ||
pip install ".[dev]" | ||
pytest -s ./tests | ||
test-npm-build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set Up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Build Vue Components | ||
run: | | ||
cd vue-components | ||
npm ci | ||
npm run build | ||
release: | ||
needs: [ | ||
pre-commit, | ||
pytest, | ||
test-npm-build, | ||
] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'push' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set Up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Build Vue Components | ||
run: | | ||
cd vue-components | ||
npm ci | ||
npm run build | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel build python-semantic-release | ||
- name: Python Semantic Release | ||
id: release | ||
uses: relekang/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
- name: Publish package distributions to GitHub Releases | ||
uses: python-semantic-release/upload-to-gh-release@main | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ steps.release.outputs.tag }} |
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,24 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
entry: black --check | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.4 | ||
hooks: | ||
- id: codespell | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
|
||
- repo: local | ||
hooks: | ||
- id: npm-lint | ||
name: Run NPM Lint in vue-components | ||
files: ^vue-components/* | ||
entry: sh -c 'cd vue-components && npm run lint' | ||
language: system |
Oops, something went wrong.