-
Notifications
You must be signed in to change notification settings - Fork 2
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 #19 from siisurit/10-add-github-ci
#10 Add GitHub CI
- Loading branch information
Showing
4 changed files
with
85 additions
and
9 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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Continuous integration build for check-done. | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.12"] | ||
env: | ||
MAIN_PYTHON_VERSION: "3.12" # same as Ubuntu 24 LTS | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- 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: Build check-done package | ||
run: | | ||
poetry build | ||
- name: Run the test suite | ||
env: | ||
CHECK_DONE_GITHUB_APP_ID: ${{ secrets.CHECK_DONE_GITHUB_APP_ID }} | ||
CHECK_DONE_GITHUB_APP_PRIVATE_KEY: | | ||
${{ secrets.CHECK_DONE_GITHUB_APP_PRIVATE_KEY }} | ||
run: | | ||
poetry run pytest --cov=check-done --cov-branch | ||
check-style: | ||
runs-on: ubuntu-latest | ||
# Disable pre-commit check on main and production to prevent | ||
# pull request merges to fail with don't commit to branch". | ||
if: github.ref != 'refs/heads/main' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install pre-commit | ||
run: | | ||
sudo apt-get install python3 python3-pip | ||
pip install pre-commit | ||
- name: Load cached pre-commit | ||
id: cached-pre-commit | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Install pre-commit hooks | ||
if: steps.cached-pre-commit.outputs.cache-hit != 'true' | ||
run: pre-commit install --install-hooks | ||
- name: Check coding style | ||
run: pre-commit run --all-files |
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 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