diff --git a/.github/workflows/build-river.yml b/.github/workflows/build-river.yml deleted file mode 100644 index e89f435527..0000000000 --- a/.github/workflows/build-river.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: build-river - -on: - workflow_call: - inputs: - python: - type: string - os: - type: string - -jobs: - build-river: - runs-on: ${{ inputs.os }} - - # Instead of using two matrices in the calling Workflow, we can use conditionals here - if: (inputs.python == '3.11') || github.event_name == 'push' - - steps: - - uses: actions/checkout@v3 - - - name: set up rust - if: runner.os != 'Linux' - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - override: true - - - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y && rustup show - if: runner.os == 'Linux' - - - name: Set up Python ${{ inputs.python }} - uses: actions/setup-python@v4 - with: - python-version: ${{ inputs.python }} - - - name: Cache the Python environment - uses: actions/cache@v3 - id: cache-venv - with: - path: ~/.venv - key: ${{ runner.os }}-${{ inputs.python }}-venv-${{ hashFiles('**/setup.py') }} - restore-keys: | - venv-${{ runner.os }}-${{ inputs.python }} - ${{ runner.os }}-${{ inputs.python }}-venv- - - - name: Install Python dependencies - if: ${{ steps.cache-venv.outputs.cache-hit != 'true' }} - run: | - python -m pip install --upgrade pip - python -m venv ~/.venv - source ~/.venv/bin/activate - pip install wheel - pip install scikit-learn sqlalchemy - pip install pytest-xdist[psutil] - pip install numpydoc jupyter - - - name: Build River - run: | - source ~/.venv/bin/activate - pip install -e ".[dev,docs]" - - # We should delete the git project from the build cache to avoid conflicts - - name: Delete the Git project - run: rm -r .git - - - uses: actions/cache/save@v3 - id: cache-river - with: - path: ${{ github.workspace }} - key: river-build-${{ runner.os }}-${{ inputs.python }} diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index ed8d96346f..f28c2f0898 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -1,6 +1,9 @@ name: code-quality on: + pull_request: + branches: + - "*" push: branches: - main @@ -9,29 +12,12 @@ jobs: ubuntu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Build River + uses: ./.github/actions/install-env with: - python-version: 3.11 - - - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y && rustup show - if: matrix.os == 'ubuntu-latest' - - - name: Cache Python dependencies - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Install Python dependencies - run: | - python -m pip install --upgrade pip - pip install wheel - pip install -e ".[dev]" + python-version: "3.12" - name: Run pre-commit on all files run: pre-commit run --all-files diff --git a/.github/workflows/docs.yml b/.github/workflows/dev-docs.yml similarity index 71% rename from .github/workflows/docs.yml rename to .github/workflows/dev-docs.yml index 376c0d2429..247e4768b1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/dev-docs.yml @@ -1,30 +1,35 @@ name: docs on: - workflow_call: + push: + branches: + - main jobs: docs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Retrieve the environment and the River build - uses: ./.github/actions/retrieve-env + - name: Build River + uses: ./.github/actions/install-env with: - python: "3.11" + python-version: "3.12" - - name: Install Ubuntu dependencies + - name: Install extra Ubuntu dependencies run: sudo apt-get install graphviz pandoc + - name: Install extra Python dependencies + run: | + poetry install --with docs + - name: Build docs run: | source ~/.venv/bin/activate make doc - name: Deploy docs - if: github.event_name == 'push' env: GH_TOKEN: ${{ secrets.GitHubToken }} run: | diff --git a/.github/workflows/release-docs.yml b/.github/workflows/release-docs.yml index fdb4a1430d..e4a6cf8b4b 100644 --- a/.github/workflows/release-docs.yml +++ b/.github/workflows/release-docs.yml @@ -10,24 +10,20 @@ jobs: ubuntu: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - - name: Install Ubuntu dependencies - run: sudo apt-get install graphviz pandoc - - - name: Set up Python - uses: actions/setup-python@v4 + - name: Build River + uses: ./.github/actions/install-env with: - python-version: "3.9" + python-version: "3.12" - - run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=nightly --profile=minimal -y && rustup show - if: matrix.os == 'ubuntu-latest' + - name: Install extra Ubuntu dependencies + run: sudo apt-get install graphviz pandoc - - name: Install Python dependencies + - name: Install extra Python dependencies run: | python -m pip install --upgrade pip - pip install wheel - pip install -e ".[compat,dev,docs]" + poetry install --with compat --with docs pip install rich python -m spacy download en_core_web_sm