Skip to content

Commit

Permalink
Add CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
RealOrangeOne committed Mar 18, 2024
1 parent bd0f2c4 commit cc71f79
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 1 deletion.
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Main

on:
push:
branches:
- master
pull_request: {}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"

- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-3.11-${{ hashFiles('poetry.lock') }}

- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.8.2

- name: Install Dependencies
run: poetry install

- name: Lint
run: poetry run ruff check .

- name: Format
run: poetry run ruff format . --check

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.11"

- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-3.11-${{ hashFiles('poetry.lock') }}

- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.8.2

- name: Install Dependencies
run: poetry install

- name: Test
run: poetry run pytest --cov=calmerge -v

build-deploy:
runs-on: ubuntu-latest
needs:
- lint
- test
steps:
- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
if: ${{ github.ref == 'refs/heads/master' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push container
uses: docker/build-push-action@v2
with:
push: ${{ github.ref == 'refs/heads/master' }}
tags: |
ghcr.io/${{ github.repository_owner }}/calmerge:latest
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ By default, `calmerge` listens on port `3000` or `$PORT`.
You will need Python and `poetry` installed.

```
poetry install
poetry install --no-dev
poetry run calmerge serve
```

Expand Down

0 comments on commit cc71f79

Please sign in to comment.