Skip to content
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

Add release pipeline #23

Merged
merged 29 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
397a6e5
ci: Add release and pre-release workflow
aiakide Jul 3, 2024
afad7fe
ci: Adjust branch configuration of python semantic release
aiakide Jul 3, 2024
09f9604
refactor: Use `rye` for project and package management instead of `po…
aiakide Aug 15, 2024
32d4646
refactor: Adjust github workflows to use rye instead of poetry
aiakide Sep 12, 2024
93b9727
refactor: Adjust import path of ExperimentType
aiakide Sep 12, 2024
8965032
test: Add UI Tests; Adjust tests.
aiakide Sep 12, 2024
48d1bef
refactor: Fix tests and use rye for test pipeline
aiakide Sep 12, 2024
97bc695
fix: Adjust test and dependency installation in pipelines
aiakide Sep 12, 2024
22e891b
refactor: Add rye lock into pipelines
aiakide Sep 12, 2024
81a59a6
refactor: adjust dependency installation
aiakide Sep 12, 2024
df40991
refactor: Remove push trigger
aiakide Sep 12, 2024
42272d9
refactor: Use only requirements-dev-lock for dependencies
aiakide Sep 12, 2024
f7f47e7
refactor: Update dependencies before installation
aiakide Sep 12, 2024
6ea27c9
refactor: Install dev dependencies when running pytest
aiakide Sep 12, 2024
c4c4cb3
refactor: Update niceml
aiakide Sep 12, 2024
e581426
refactor: Use rye to run pytest
aiakide Sep 13, 2024
62567f8
refactor: Install dependencies using rye
aiakide Sep 13, 2024
4855b87
refactor: Cleanup test workflow
aiakide Sep 13, 2024
06e26a9
Merge branch 'develop' into feature/release-pipeline
aiakide Sep 13, 2024
d56c8dd
refactor: Adjust test after merge
aiakide Sep 13, 2024
8ca3258
refactor: Adjust workflow permissions
aiakide Sep 13, 2024
e7108e5
refactor: Add macos and windows to pipeline matrix
aiakide Sep 13, 2024
f3aef6a
refactor: Add chromedriver konfiguration
aiakide Sep 13, 2024
82f429e
refactor: Use different action to install chrome drive
aiakide Sep 13, 2024
682a543
fix: User different chrome version
aiakide Sep 13, 2024
62c12d9
fix: Change shell based on runner.os
aiakide Sep 13, 2024
6392ccf
refactor: Use version 4 of artifact upload action
aiakide Sep 13, 2024
62ca4ba
fix: Update release workflows
aiakide Sep 13, 2024
34ab1fa
refactor: Remove push trigger
aiakide Sep 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/pre-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 🍦 Create Pre-Release

on:
pull_request:
branches:
- develop
types:
- closed
permissions:
contents: write
checks: write
pull-requests: write
jobs:
release:
if: ${{ github.event.pull_request.merged }}
name: 🏗️ Build package and publish to pypi
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/nicemldashboard
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
with:
ref: 'develop'
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: 🐍Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: 🚀 Python Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: 🐍 Publish package distributions to PyPI
uses: pypa/[email protected]
if: steps.release.outputs.released == 'true'

- name: 🐙 Publish package distributions to GitHub Releases
uses: python-semantic-release/[email protected]
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 🍦 Create Release

on:
pull_request:
branches:
- main
types:
- closed
permissions:
contents: write
checks: write
pull-requests: write
jobs:
release:
if: ${{ github.event.pull_request.merged }}
name: 🏗️ Build package and publish to pypi
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/nicemldashboard
steps:
- name: ⬇️ Checkout repository
uses: actions/checkout@v3
with:
ref: 'main'
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: 🐍Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: 🚀 Python Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: 🐍 Publish package distributions to PyPI
uses: pypa/[email protected]
if: steps.release.outputs.released == 'true'

- name: 🐙 Publish package distributions to GitHub Releases
uses: python-semantic-release/[email protected]
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
38 changes: 27 additions & 11 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
types: [ opened, reopened, synchronize ]
workflow_call:
permissions:
id-token: write
contents: write
checks: write
pull-requests: write
Expand All @@ -13,8 +14,8 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: [ "3.9", "3.10", "3.11"]
os: [ ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
name: 🧪 Run pytests
Expand All @@ -25,25 +26,40 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: 🔨 Setup poetry
uses: abatilo/actions-poetry@v2
- name: 🔨Install rye
uses: eifinger/setup-rye@v4
with:
poetry-version: "1.7.1"
- name: 🧙 Install dependencies
enable-cache: true
- name: 🔨Install chrome driver
uses: browser-actions/setup-chrome@v1
with:
chrome-version: '128'
install-chromedriver: true
- name: 🔨Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
rye pin ${{ matrix.python-version }}
rye lock --update-all
rye sync
shell: cmd
- name: 🔨Install dependencies (Unix)
if: runner.os != 'Windows'
run: |
poetry config virtualenvs.create false
poetry install --no-interaction --with dev --no-ansi
rye pin ${{ matrix.python-version }}
rye lock --update-all
rye sync
shell: bash
- run: mkdir results && touch results/test-results-${{ matrix.python-version }}-${{matrix.os}}-summary.md
- name: 🧪 Run tests
uses: aiakide/pytest-summary@main
uses: aiakide/pytest-summary@rye
with:
extensions: pytest-cov
extensions: pytest-cov icecream selenium pytest-selenium
options: --doctest-modules --cov-report term --cov-report xml:coverage-${{ matrix.python-version }}-${{matrix.os}}.xml --cov=nicemldashboard
paths: tests/**
output: test-results-${{ matrix.python-version }}-${{matrix.os}}-summary.md
show: "fail, skip"
- name: ⬆️ Upload pytest results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
poetry.toml
.venv

.python-version


**/__pycache__/

.DS_Store

experiments/

experiment_cache/

screenshots/
65 changes: 35 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.264
hooks:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: ruff
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
exclude: ^tests/
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.3.1
hooks:
- id: python-safety-dependencies-check
args: ["--ignore=42194,43975,47833,44487,45356,43975,51668"]
files: pyproject.toml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
types: [yaml]
- id: check-json
types: [json]
- id: check-toml
types: [toml]
- id: no-commit-to-branch
args: ["--branch", "main"]
- id: end-of-file-fixer
name: Ruff check
description: "Run 'ruff check' for extremely fast Python linting"
args: [ --fix ]
- id: ruff-format
name: Ruff format
description: "Run 'ruff format' for extremely fast Python formatting"
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
- id: hadolint
name: Lint Dockerfiles
description: Runs hadolint to lint Dockerfiles
language: system
types: ["dockerfile"]
entry: hadolint
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
exclude: ^tests/
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
types: [yaml]
- id: check-json
types: [json]
- id: check-toml
types: [toml]
- id: no-commit-to-branch
args: ["--branch", "main"]
- id: end-of-file-fixer
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.14
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# niceml-dashboard
- Welcome on board.

## Getting Started
We use [rye](https://rye.astral.sh) to manage our dependencies.
To start developing niceml-dashboard [install rye](https://rye.astral.sh/guide/installation/) on your system.
Then run the following command so that rye creates a virtual environment with all the required dependencies.
```bash
rye sync
```
Loading
Loading