-
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 #4 from IsaacCheng9/add-ci
Add CI pipelines for testing and formatting
- Loading branch information
Showing
4 changed files
with
80 additions
and
0 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,31 @@ | ||
name: Format | ||
|
||
on: [push] | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.12.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run Python code formatting with Black | ||
uses: lgeiger/[email protected] | ||
with: | ||
args: "." | ||
|
||
- name: Commit changes made by Black | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: Format Python code with Black | ||
|
||
- name: Switch to current branch | ||
run: git checkout ${{ env.BRANCH }} | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} |
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,45 @@ | ||
name: Test | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push events but only for the main branch. | ||
push: | ||
# Allows you to run this workflow manually from the Actions tab. | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
# The type of runner that the job will run on. | ||
runs-on: macos-latest | ||
# Configures the build to use the latest version of Python 3. | ||
strategy: | ||
matrix: | ||
python-version: [3.12.x] | ||
|
||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can | ||
# access it. | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Switch to current branch | ||
run: git checkout ${{ env.BRANCH }} | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install poetry | ||
- name: Install Python dependencies with Poetry | ||
run: | | ||
poetry install | ||
- name: Run unit tests with Pytest | ||
run: poetry run coverage run --source=src/boruvkas_algorithm -m pytest -v | ||
|
||
- name: Get code coverage report | ||
run: poetry run coverage report -m |
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