diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..c05b5fe93 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +/.github/ @thomass-dev @rouk1 @augustebaum diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml new file mode 100644 index 000000000..bcdb45352 --- /dev/null +++ b/.github/workflows/backend.yml @@ -0,0 +1,59 @@ +# THIS +# IS +# DOCUMENTATION +# REUSABLE WORKFLOW + +name: Backend + +on: [workflow_call] + +defaults: + run: + shell: "bash" + +jobs: + test-skore: + strategy: + fail-fast: true + matrix: + os: ["ubuntu-latest", "windows-latest"] + python: ["3.9", "3.10", "3.11", "3.12"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + cache: "pip" + - name: Setup + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade pre-commit + python -m pip install --upgrade build + - name: Lint + working-directory: skore/ + run: pre-commit run --all-files ruff + - name: Build + working-directory: skore/ + run: python -m build + - name: Install + working-directory: skore/ + run: wheel=(dist/*.whl); python -m pip install "${wheel}[test]" + - name: Test without coverage + if: matrix.os != 'ubuntu-latest' || matrix.python != '3.12' + timeout-minutes: 10 + working-directory: skore/ + run: python -m pytest --no-cov src/ tests/ + - name: Test with coverage + if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12' + timeout-minutes: 10 + working-directory: skore/ + run: | + mkdir coverage + python -m pytest --junitxml=coverage/coverage.xml --cov=skore src/ tests/ | tee coverage/coverage.txt + - name: Upload coverage reports + if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12' + uses: actions/upload-artifact@v4 + with: + name: backend-coverage + path: skore/coverage/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3db1d26d..eaed00434 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: - 'skore/tests/**' - 'skore/pyproject.toml' - 'skore/requirements*.txt' - - '.github/workflows/skore.yml' + - '.github/workflows/skore-test.yml' skore-ui: - 'skore-ui/**' - '.github/workflows/skore-ui.yml' @@ -42,10 +42,9 @@ jobs: lint-and-test-skore: needs: [lint-all-files, changes] if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'pull_request' && needs.changes.outputs.skore == 'true') }} - uses: ./.github/workflows/skore.yml + uses: ./.github/workflows/skore-test.yml permissions: contents: read - pull-requests: write lint-and-test-skore-ui: needs: [lint-all-files, changes] @@ -53,7 +52,6 @@ jobs: uses: ./.github/workflows/skore-ui.yml permissions: contents: read - pull-requests: write ci-all-green: needs: diff --git a/.github/workflows/skore-ui.yml b/.github/workflows/frontend.yml similarity index 78% rename from .github/workflows/skore-ui.yml rename to .github/workflows/frontend.yml index 6f1b63876..57264d394 100644 --- a/.github/workflows/skore-ui.yml +++ b/.github/workflows/frontend.yml @@ -1,11 +1,15 @@ -name: Reusable skore-ui workflow +# THIS +# IS +# DOCUMENTATION +# REUSABLE WORKFLOW + +name: Frontend on: [workflow_call] defaults: run: shell: 'bash' - working-directory: './skore-ui' jobs: lint-skore-ui: @@ -18,6 +22,7 @@ jobs: cache: 'npm' cache-dependency-path: skore-ui/package-lock.json - name: Lint skore-ui + working-directory: skore-ui/ run: | npm install npm run type-check @@ -27,7 +32,6 @@ jobs: test-skore-ui: runs-on: ubuntu-latest - needs: lint-skore-ui steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -36,19 +40,18 @@ jobs: cache: 'npm' cache-dependency-path: skore-ui/package-lock.json - name: Test skore-ui + working-directory: skore-ui/ run: | npm install npm run test:unit:coverage - - name: Report coverage - if: always() - uses: davelosert/vitest-coverage-report-action@v2 + - name: Upload coverage reports + uses: actions/upload-artifact@v4 with: - working-directory: ./skore-ui - pr-number: ${{ github.event.number }} + name: frontend-coverage + path: skore-ui/coverage/ build-skore-ui: runs-on: ubuntu-latest - needs: test-skore-ui steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -57,6 +60,7 @@ jobs: cache: 'npm' cache-dependency-path: skore-ui/package-lock.json - name: Build skore-ui + working-directory: skore-ui/ run: | npm install npm run build diff --git a/.github/workflows/add-pr-assignee.yml b/.github/workflows/pr-add-assignee.yml similarity index 97% rename from .github/workflows/add-pr-assignee.yml rename to .github/workflows/pr-add-assignee.yml index c6570c0aa..6a78b0c45 100644 --- a/.github/workflows/add-pr-assignee.yml +++ b/.github/workflows/pr-add-assignee.yml @@ -1,7 +1,7 @@ name: Add PR assignee on: - pull_request: + pull_request_target: types: [opened] jobs: diff --git a/.github/workflows/pr-display-backend-coverage.yml b/.github/workflows/pr-display-backend-coverage.yml new file mode 100644 index 000000000..5ad4f529c --- /dev/null +++ b/.github/workflows/pr-display-backend-coverage.yml @@ -0,0 +1,32 @@ +name: send backend coverage + +on: + workflow_run: + workflows: [Reusable skore workflow] + types: [completed] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + pull-requests: write + +jobs: + send-coverage-message: + runs-on: ubuntu-latest + if: > + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' + steps: + - name: Download coverage reports + uses: actions/download-artifact@v4 + with: + name: backend-coverage + path: coverage/ + - name: Send + uses: MishaKav/pytest-coverage-comment@main + with: + pytest-coverage-path: coverage/coverage.txt + junitxml-path: coverage/coverage.xml + title: pytest coverage report diff --git a/.github/workflows/pr-display-frontend-coverage.yml b/.github/workflows/pr-display-frontend-coverage.yml new file mode 100644 index 000000000..ab2906ac6 --- /dev/null +++ b/.github/workflows/pr-display-frontend-coverage.yml @@ -0,0 +1,5 @@ + # - name: Report coverage + # uses: davelosert/vitest-coverage-report-action@v2 + # with: + # working-directory: ./skore-ui + # pr-number: ${{ github.event.number }} diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/pr-lint-title.yml similarity index 100% rename from .github/workflows/lint-pr-title.yml rename to .github/workflows/pr-lint-title.yml diff --git a/.github/workflows/pr-serve-documentation.yml b/.github/workflows/pr-serve-documentation.yml new file mode 100644 index 000000000..e69de29bb diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f1f44d21f..7b32460ba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,7 @@ +# THIS +# IS +# DOCUMENTATION + name: Release on: diff --git a/.github/workflows/skore.yml b/.github/workflows/skore.yml deleted file mode 100644 index 24ec97412..000000000 --- a/.github/workflows/skore.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Reusable skore workflow - -on: [workflow_call] - -defaults: - run: - shell: "bash" - working-directory: "./skore" - -jobs: - test-skore: - strategy: - fail-fast: true - matrix: - os: ["ubuntu-latest", "windows-latest"] - python-version: ["3.9", "3.10", "3.11", "3.12"] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - name: - timeout-minutes: 10 - run: | - # Install dependencies - python -m pip install --upgrade pip - python -m pip install --upgrade pre-commit - python -m pip install --upgrade build - - # Lint - pre-commit run --all-files ruff - - # Build - python -m build - - # Install - wheel=(dist/*.whl); python -m pip install "${wheel}[test]" - - # Test - python -m pytest --no-cov src/ tests/ - - coverage-skore: - runs-on: ubuntu-latest - if: ${{ github.event_name == 'pull_request' }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: 3.12 - cache: "pip" - - name: pytest coverage - run: | - # Install dependencies - python -m pip install --upgrade pip - python -m pip install --upgrade pre-commit - python -m pip install --upgrade build - python -m pip install -e .[test] - - # run coverage - python -m pytest --junitxml=coverage.xml --cov=skore src/ tests/ | tee pytest-coverage.txt - - name: Pytest coverage comment - uses: MishaKav/pytest-coverage-comment@main - with: - pytest-coverage-path: ./skore/pytest-coverage.txt - junitxml-path: ./skore/coverage.xml - title: pytest coverage report