-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- split CI workflow into three pieces `lint`/`frontend`/`backend` to run workflows only when needed - run tests only on `pull_request` events - add dedicated build step in frontend workflow - update `pre-commit` hooks version to be up-to-date --------- Co-authored-by: Auguste Baum <auguste@probabl.ai>
- Loading branch information
1 parent
ff7f368
commit 879e5ce
Showing
9 changed files
with
150 additions
and
70 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,53 @@ | ||
name: Backend | ||
|
||
on: | ||
pull_request: | ||
types: [synchronize] | ||
paths: | ||
- 'src/**' | ||
- 'tests/**' | ||
- pyproject.toml | ||
- Makefile | ||
- requirements*.txt | ||
- .github/workflows/backend.yml | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Lint | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade pre-commit | ||
pre-commit run --all-files ruff | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Build frontend and share library | ||
shell: bash | ||
run: make build-frontend | ||
- name: Build package distributions | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade build | ||
python -m build | ||
- name: Install | ||
run: | | ||
python -m pip install dist/*.whl --no-dependencies | ||
python -m pip install -r requirements.txt -r requirements-test.txt | ||
- name: Pytest | ||
timeout-minutes: 5 | ||
run: python -m pytest |
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,62 @@ | ||
name: Frontend | ||
|
||
on: | ||
pull_request: | ||
types: [synchronize] | ||
paths: | ||
- 'frontend/**' | ||
- Makefile | ||
- .github/workflows/lint-frontend.yml | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
- name: Lint | ||
run: | | ||
cd frontend | ||
npm install | ||
npm run type-check | ||
npm run lint | ||
npm run format | ||
npm run style-lint | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
- name: Test | ||
run: | | ||
cd frontend | ||
npm install | ||
npm run test:unit:coverage | ||
- name: Report coverage | ||
if: always() | ||
uses: davelosert/vitest-coverage-report-action@v2 | ||
with: | ||
working-directory: ./frontend | ||
pr-number: ${{ github.event.number }} | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
- name: Build | ||
shell: bash | ||
run: make build-frontend |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Lint | ||
|
||
on: [pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Lint | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --upgrade pre-commit | ||
pre-commit run --all-files check-yaml | ||
pre-commit run --all-files check-toml | ||
pre-commit run --all-files check-added-large-files | ||
pre-commit run --all-files check-merge-conflict | ||
pre-commit run --all-files detect-private-key | ||
pre-commit run --all-files end-of-file-fixer | ||
pre-commit run --all-files trailing-whitespace | ||
pre-commit run --all-files typos |
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ on: | |
pull_request: | ||
types: [opened] | ||
|
||
|
||
jobs: | ||
add-assignee: | ||
runs-on: ubuntu-latest | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.1.0-rc.1 | ||
0.0.0 |
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