Une première PR qui gère plein de bugs détectés par Nicolas (#630) #106
This file contains hidden or 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
| name: Testing colab build | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| - colab | |
| jobs: | |
| enonces: | |
| name: Render notebooks | |
| runs-on: ubuntu-latest | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| repository: ${{github.event.pull_request.head.repo.full_name}} | |
| - name: Configure safe.directory # Workaround for actions/checkout#760 | |
| run: git config --global --add safe.directory /__w/python-datascientist/python-datascientist | |
| - name: Install system dependencies | |
| run: | | |
| sudo ./build/requirements.sh | |
| - name: Install the latest version of uv and set the python version to 3.13t | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: "3.12" | |
| enable-cache: true | |
| cache-dependency-glob: "uv.lock" | |
| - uses: quarto-dev/quarto-actions/setup@v2 | |
| - run: | | |
| quarto --version | |
| - name: Prepare directory | |
| run: | | |
| rm _quarto.yml | |
| cp _quarto-prod.yml _quarto.yml | |
| - name: Install Python dependencies | |
| run: | | |
| uv sync | |
| - name: Convert in ipynb with Quarto | |
| env: | |
| API_INPI_USERNAME: ${{ secrets.API_INPI_USERNAME }} | |
| API_INPI_PASSWORD: ${{ secrets.API_INPI_PASSWORD }} | |
| run: | | |
| rm content/modelisation/index.qmd # Remove file not building in ipynb | |
| rm -rf content/git/ # ignore git chapters | |
| rm content/modelisation/4_featureselection.qmd | |
| rm content/manipulation/04c_API_TP.qmd | |
| rm content/NLP/02_exoclean.qmd | |
| rm content/manipulation/04c_API_TP.qmd | |
| uv run build/colab/tweak_quarto_project.py --overwrite | |
| uv run quarto render --to ipynb | |
| - name: Move to expected directory | |
| env: | |
| API_INPI_USERNAME: ${{ secrets.API_INPI_USERNAME }} | |
| API_INPI_PASSWORD: ${{ secrets.API_INPI_PASSWORD }} | |
| run: | | |
| mkdir -p temp_notebooks | |
| mkdir -p temp_notebooks/notebooks | |
| uv run build/move_files.py --direction temp_notebooks/notebooks | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Source enonce | |
| path: content/ | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: Enonces | |
| path: temp_notebooks/notebooks/ | |
| - name: Pushes to another repository | |
| uses: linogaliana/github-action-push-to-another-repository@main | |
| env: | |
| API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
| with: | |
| source-directory: 'temp_notebooks/' | |
| destination-repository-username: 'linogaliana' | |
| destination-repository-name: 'python-datascientist-notebooks-colab' | |
| user-email: [email protected] | |
| destination-github-username: linogaliana | |
| #target-branch: test | |
| create-target-branch-if-needed: true | |
| reset-repo: true | |