Skip to content

Commit

Permalink
add files for setup CI (#2)
Browse files Browse the repository at this point in the history
* add files for setup CI

* update
  • Loading branch information
shunk031 committed Sep 20, 2024
1 parent fa4fa5d commit 2f834e3
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 31 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
- name: Install dependencies
run: |
make setup
make install
- name: Format
run: |
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install dependencies
run: |
make setup
- name: Build and publish
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi ${PYPI_API_TOKEN}
poetry publish --build
24 changes: 24 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
push:
branches: [main]

jobs:
tagpr:
runs-on: ubuntu-latest

steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}

- uses: Songmu/tagpr@v1
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
41 changes: 11 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
#
# Installation
#

.PHONY: setup
setup:
pip install -U --no-cache-dir pip setuptools wheel poetry

.PHONY: install
install:
pip install -U pip setuptools wheel poetry
poetry install

.PHONY: install-datasets
install-datasets:
poetry install --extras datasets

.PHONY: install-cocoapi
install-cocoapi:
poetry install --extras cocoapi

.PHONY: install-all
install-all:
poetry install --extras all

#
# linter/formatter/typecheck
#
.PHONY: format
format:
poetry run ruff format --check --diff .

.PHONY: lint
lint: install
lint:
poetry run ruff check --output-format=github .

.PHONY: format
format: install
poetry run ruff format --check --diff .

.PHONY: typecheck
typecheck: install
poetry run mypy --cache-dir=/dev/null .
typecheck:
poetry run mypy .

.PHONY: test
test:
poetry run pytest

0 comments on commit 2f834e3

Please sign in to comment.