-
Notifications
You must be signed in to change notification settings - Fork 6
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
refactor: CI 통합 #42
Open
Lapis0875
wants to merge
5
commits into
koreanbots:master
Choose a base branch
from
Lapis0875:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
refactor: CI 통합 #42
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1e4cb33
refactor: CI 통합
Lapis0875 9637839
refactor: CI 순서 조정
Lapis0875 809fa12
refactor: client fixture에 주석 추가
Lapis0875 7001844
refactor: client fixture를 pytest_asyncio의 fixture로 변경.
Lapis0875 35dc138
feat: pytest 컨피그 추가. asyncio_mode를 auto로 설정.
Lapis0875 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
release: | ||
types: [ created ] | ||
|
||
|
||
jobs: | ||
style: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install black isort | ||
- name: Checking style | ||
run: | | ||
black ./koreanbots --check | ||
isort ./koreanbots --check --profile=black | ||
|
||
type: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
sudo npm install -g pyright | ||
python -m pip install -r requirements.txt | ||
python -m pip install mypy | ||
- name: Install integrations | ||
run: | | ||
python -m pip install git+https://github.com/rapptz/discord.py | ||
python -m pip install dico nextcord disnake | ||
- name: Checking type annotations | ||
run: | | ||
mypy ./koreanbots --strict | ||
pyright ./koreanbots --outputjson | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: [ style, type ] | ||
strategy: | ||
matrix: | ||
python-version: [ 3.8, 3.9 ] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pytest pytest-cov pytest-asyncio | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Test with pytest | ||
run: | | ||
pytest --cov=koreanbots --cov-report=xml | ||
- name: Codecov | ||
uses: codecov/codecov-action@v1 | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: [ style, type, build ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -7,4 +7,7 @@ | |
|
||
@fixture | ||
async def client(): | ||
""" | ||
client params in test. | ||
""" | ||
yield Koreanbots(api_key=getenv("API_KEY")) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 프로세스는 빌드가 생성 될시에만 실행이 되나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
우선 build에 의존시켜뒀으니, 그럴거라고 생각합니다. 다만 테스트에서 오류가 나 이후의 동작은 확인하지 못했습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
테스트 오류 해결 후 확인했습니다. build까지 동작 이후에 deploy가 동작합니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
배포는 릴리즈 이벤트가 발생될때만 작동하게 하면 될것같아요 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아아 그러네요!