Skip to content

Update scikit-learn to version 1.5 #1535

Update scikit-learn to version 1.5

Update scikit-learn to version 1.5 #1535

Workflow file for this run

name: Test Assets
permissions:
contents: read
on:
pull_request:
types: [opened,synchronize]
branches-ignore:
- testing
workflow_dispatch: {}
jobs:
build_strategy_matrix:
runs-on: ubuntu-latest
steps:
- name: Get the current branch name
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
id: myref
- uses: actions/checkout@v3
- id: set-matrix
# This is very hacky, but it goes like that:
# 1) Associate base_ref with origin/base_ref since actions/checkout doesn't do it, if we don't do that we won't be able to check the actual diff
# 2) Build JSON string
# 2.1) Add beginning of JSON
# 2.2) Get diff between origin/base_ref and the checked-out repo => git diff ${{ github.base_ref }} --name-only
# 2.3) Clean the file name and leave us only with directories => sed 's,/*[^/]\+/*$,,'
# 2.4) Sort and keep only unique directories => sort | uniq
# 2.5) Remove directories starting with '.' => grep -v '^\.'
# 2.6) Add quotation marks to all strings => sed 's/.*/"&"/'
# 2.7) Add comma suffix to all strings excluding the last one => sed '$!s/.*/&,/'
# 2.8) Close JSON
# 3) Save matrix JSON to output
# This is previous fetch command that stopped working (wile invetsigating added WA bello in run sectiong): git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
# This is old git diff version: git diff ${{ github.base_ref }} --name-only | sed 's,/*[^/]\+/*$,,' | sort | uniq | grep -v '^\.' | sed 's/.*/"&"/' | sed '$!s/.*/&,/'
# Based on instructions regarding https://docs.github.com/en/actions/learn-github-actions/contexts#github-context , github.base_ref triggers a workflow run is either pull_request or pull_request_target
run: |
echo "base ref: ${{ github.base_ref }}"
git fetch origin ${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
base_ref="origin/${{ github.base_ref }}"
echo "Diffing against $base_ref:"
changed_files="$(git diff "$base_ref" --name-only || true)"
# Collect candidate package paths from diff
candidates=$(
printf '%s\n' "$changed_files" \
| awk -F'/' '
/^functions\/src\// {print $1"/"$2"/"$3}
/^modules\/src\// {print $1"/"$2"/"$3}
/^steps\/src\// {print $1"/"$2"/"$3}
' \
| sort -u
)
# Keep only those that are actual directories
packages=""
for dir in $candidates; do
if [[ -d "$dir" ]]; then
packages+="$dir"$'\n'
fi
done
if [[ -z "$packages" ]]; then
matrix_json='{"package":[]}'
else
matrix_json=$(printf '%s\n' "$packages" \
| grep -v '^$' \
| jq -R . \
| jq -s '{package: .}' \
| jq -c) # <-- compact
fi
echo "matrix=$matrix_json" >> "$GITHUB_OUTPUT"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
check_matrix:
runs-on: ubuntu-latest
needs: build_strategy_matrix
steps:
- name: Install json2yaml
run: |
sudo npm install -g json2yaml
- name: Check matrix definition
run: |
matrix='${{ needs.build_strategy_matrix.outputs.matrix }}'
echo $matrix
echo $matrix | jq .
echo $matrix | json2yaml
run_monorepo_tests:
needs: build_strategy_matrix
if: needs.build_strategy_matrix.outputs.matrix != '{"package":[]}'
runs-on: ubuntu-latest
strategy:
# matrix: [{"package": some package that changed}, {...}, ...]
matrix: ${{fromJson(needs.build_strategy_matrix.outputs.matrix)}}
steps:
- name: Checkout current repo
uses: actions/checkout@v3
# Install python 3.10.17
- name: Install python 3.10.17
uses: actions/setup-python@v4
with:
python-version: 3.10.17
# Install dependencies
- uses: actions/cache@v3
id: cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install requirements
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Print workspace structure
run: |
echo "Current directory: $(pwd)"
echo "Tree structure:"
find . -type f | sort
- name: Run py tests
run: python -m cli.cli run-tests -r ${{ matrix.package }} -s py -fn $(basename "${{ matrix.package }}")