Skip to content

Commit

Permalink
0.3.1 - adjust workflows
Browse files Browse the repository at this point in the history
Adjust the format of the workflow files.
  • Loading branch information
cainmagi committed Sep 14, 2024
1 parent b228b16 commit ad4f826
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 73 deletions.
83 changes: 41 additions & 42 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,55 @@ name: Python package

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Chrome
uses: browser-actions/setup-chrome@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- name: Enable Corepack
run: |
npm install -g corepack
corepack enable
- name: Yarn run install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest wheel
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Use Yarn to build component
uses: borales/actions-yarn@v4
with:
cmd: build
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --ignore=E203,E501,W503,E701,E704 --statistics
- name: Test with pytest
run: |
python -m pytest --headless --with-dash
- uses: actions/checkout@v4
- name: Set up Chrome
uses: browser-actions/setup-chrome@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "npm"
- name: Enable Corepack
run: |
npm install -g corepack
corepack enable
- name: Yarn run install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest wheel
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
if [ -f tests/requirements.txt ]; then python -m pip install -r tests/requirements.txt; fi
- name: Use Yarn to build component
uses: borales/actions-yarn@v4
with:
cmd: build
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --ignore=E203,E501,W503,E701,E704 --statistics
- name: Test with pytest
run: |
python -m pytest --headless --with-dash
63 changes: 32 additions & 31 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,35 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Set up Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- name: Enable Corepack
run: |
npm install -g corepack
corepack enable
- name: Yarn run install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Use Yarn to build component
uses: borales/actions-yarn@v4
with:
cmd: build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Set up Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: "npm"
- name: Enable Corepack
run: |
npm install -g corepack
corepack enable
- name: Yarn run install
uses: borales/actions-yarn@v4
with:
cmd: install
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then python -m pip install -r requirements-dev.txt; fi
- name: Use Yarn to build component
uses: borales/actions-yarn@v4
with:
cmd: build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
2. Adjust project details in the readme.
3. Add an explanation about `data` in the readme.
4. Adjust the metadata of the project, and remove the auto-genreated file.
5. Adjust the format of the workflow files.

### 0.3.0 @ 09/13/2024

Expand Down

0 comments on commit ad4f826

Please sign in to comment.