-
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 #8 from Namgyu-Youn/04-GitHub_Action
Update CI/CD, Ruff setting
- Loading branch information
Showing
21 changed files
with
556 additions
and
1,486 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,31 +1,50 @@ | ||
{% set name = "topicgen" %} | ||
{% set version = "0.1.2" %} | ||
|
||
package: | ||
name: {{ name|lower }} | ||
version: {{ version }} | ||
|
||
source: | ||
path: ../../ | ||
|
||
build: | ||
noarch: python | ||
number: 0 | ||
script: {{ PYTHON }} -m pip install . -vv | ||
|
||
requirements: | ||
host: | ||
- numpy | ||
- torch | ||
- transformers | ||
- gradio | ||
- aiohttp | ||
- python-dotenv | ||
- pip | ||
- python >=3.10,<3.13 | ||
- poetry-core | ||
run: | ||
- python >=3.10,<3.13 | ||
- numpy | ||
- torch | ||
- transformers | ||
- gradio | ||
- aiohttp | ||
- python-dotenv | ||
- ruff | ||
- tiktoken | ||
- protobuf | ||
- sentencepiece | ||
- tokenizers | ||
|
||
test: | ||
imports: | ||
- topicgen | ||
- transformers | ||
|
||
about: | ||
home: https://github.com/Namgyu-Youn/github-topic-generator | ||
home: https://github.com/Namgyu-Youn/topicgen | ||
license: MIT | ||
license_file: LICENSE | ||
summary: "github-topic-generator : Generate related topics('#') by analyzing your source code." | ||
summary: "topicgen: Generate related topics('#') by analyzing your source code." | ||
doc_url: https://github.com/Namgyu-Youn/topicgen | ||
dev_url: https://github.com/Namgyu-Youn/topicgen | ||
|
||
extra: | ||
recipe-maintainers: | ||
- Namgyu-Youn |
This file was deleted.
Oops, something went wrong.
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,32 +1,61 @@ | ||
name: CI | ||
name: CI/CD Workflow | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
lint-and-test: | ||
strategy: | ||
matrix: | ||
# os: [ubuntu-latest] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ['3.11'] | ||
# python-version: ['3.10', '3.11'] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install Poetry | ||
run: | | ||
pipx install poetry | ||
echo "/root/.local/bin" >> $GITHUB_PATH | ||
- name: Configure Poetry | ||
run: | | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: Install dependencies | ||
run: | | ||
poetry install --no-root | ||
- name: Lint with Ruff | ||
run: | | ||
poetry run ruff check . | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Hadolint | ||
uses: hadolint/[email protected] | ||
continue-on-error: true | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction | ||
|
||
- name: Run linters | ||
run: | | ||
poetry run ruff check . | ||
poetry run ruff format . | ||
- name: ONNX Model Conversion | ||
run: | | ||
poetry run python -c "from scripts.analyzer import TopicAnalyzer; analyzer = TopicAnalyzer(); analyzer._convert_to_onnx()" | ||
- name: Run tests | ||
run: | | ||
poetry run pytest tests/ | ||
poetry run pytest --cov=topicgen |
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,35 @@ | ||
name: Conda Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: # Manual trigger option | ||
|
||
jobs: | ||
conda-build: | ||
name: Build Conda Package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Conda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-activate-base: true | ||
python-version: "3.12" | ||
|
||
- name: Install conda-build | ||
run: | | ||
conda install conda-build anaconda-client conda-verify -y | ||
- name: Build conda package | ||
run: | | ||
conda build .github/conda | ||
- name: Upload to Anaconda.org | ||
if: github.event_name == 'release' | ||
env: | ||
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | ||
run: | | ||
anaconda login --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_TOKEN }} | ||
anaconda upload /usr/share/miniconda/conda-bld/noarch/topicgen-*.tar.bz2 |
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 |
---|---|---|
|
@@ -13,4 +13,6 @@ flagged | |
.gradio | ||
|
||
# Ruff | ||
-unsafe-fixes | ||
-unsafe-fixes | ||
.ruff_cache | ||
.coverage |
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
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,17 +1,26 @@ | ||
{ | ||
"python.formatting.provider": "black", | ||
// Global formatting settings | ||
"editor.formatOnSave": true, | ||
"editor.renderWhitespace": "trailing", | ||
"editor.rulers": [120], | ||
"python.linting.enabled": true, | ||
"python.linting.ruffEnabled": true, | ||
"files.trimTrailingWhitespace": true, | ||
"files.insertFinalNewline": true, | ||
|
||
// Python-specific settings | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.defaultFormatter": "charliermarsh.ruff", | ||
"editor.formatOnSave": true, | ||
"editor.tabSize": 4, | ||
"editor.rulers": [120], | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true, | ||
"source.organizeImports": true | ||
"source.fixAll": "explicit", | ||
"source.organizeImports": "explicit" | ||
} | ||
}, | ||
"ruff.lint.run": "onSave" | ||
|
||
// YAML settings (important for GitHub Actions) | ||
"[yaml]": { | ||
"editor.defaultFormatter": "redhat.vscode-yaml", | ||
"editor.tabSize": 2 | ||
} | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.