Skip to content

Commit 5bf88b4

Browse files
authored
TEST-modin-project#6282: Reduce copy-pasteness in ci.yml (modin-project#6283)
Signed-off-by: Vasily Litvinov <fam1ly.n4me@yandex.ru>
1 parent 5cd15a5 commit 5bf88b4

File tree

14 files changed

+309
-677
lines changed

14 files changed

+309
-677
lines changed

.github/actions/mamba-env/action.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "Install environment using Mamba"
2+
description: "Prepare the environment to run Modin"
3+
inputs:
4+
python-version:
5+
description: "Python version to install"
6+
default: "3.8"
7+
environment-file:
8+
description: "Conda environment yml"
9+
required: true
10+
activate-environment:
11+
description: "Conda environment to activate"
12+
default: "modin"
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Get current week
18+
id: get-week
19+
# use current week as cache key to periodically refresh the cache,
20+
# as cache is based on requirements, but dependencies push
21+
# updated versions at some irregular pace
22+
run: echo "thisweek=$(/bin/date -u '+%Y.w%W')" >> $GITHUB_OUTPUT
23+
shell: bash
24+
- name: Cache conda
25+
id: cache-conda
26+
uses: actions/cache@v3
27+
with:
28+
path: |
29+
~/conda_pkgs_dir
30+
~/.cache/pip
31+
key:
32+
${{ runner.os }}-conda-${{ steps.get-week.outputs.thisweek }}-${{ hashFiles(inputs.environment-file) }}
33+
- uses: conda-incubator/setup-miniconda@v2
34+
with:
35+
miniforge-variant: Mambaforge
36+
miniforge-version: latest
37+
use-mamba: true
38+
activate-environment: ${{ inputs.activate-environment }}
39+
environment-file: ${{ inputs.environment-file }}
40+
python-version: ${{ inputs.python-version }}
41+
channel-priority: strict
42+
# we set use-only-tar-bz2 to false in order for conda to properly find new packages to be installed
43+
# for more info see https://github.com/conda-incubator/setup-miniconda/issues/264
44+
use-only-tar-bz2: false
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: "Install Python only"
2+
description: "Prepare the environment to run simple tasks"
3+
inputs:
4+
python-version:
5+
description: "Python version to install"
6+
default: "3.8.x"
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- uses: actions/setup-python@v4
12+
with:
13+
python-version: ${{ inputs.python-version }}
14+
architecture: "x64"
15+
cache: 'pip'
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Run core Modin tests"
2+
description: "Run core Modin tests like dataframe or groupby"
3+
inputs:
4+
runner:
5+
description: "Runner for tests"
6+
default: "python -m pytest"
7+
parallel:
8+
description: "How to run tests in parallel"
9+
default: "-n 2"
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- uses: ./.github/actions/run-core-tests/group_1
15+
with:
16+
runner: ${{ inputs.runner }}
17+
parallel: ${{ inputs.parallel }}
18+
- uses: ./.github/actions/run-core-tests/group_2
19+
with:
20+
runner: ${{ inputs.runner }}
21+
parallel: ${{ inputs.parallel }}
22+
- uses: ./.github/actions/run-core-tests/group_3
23+
with:
24+
runner: ${{ inputs.runner }}
25+
parallel: ${{ inputs.parallel }}
26+
- uses: ./.github/actions/run-core-tests/group_4
27+
with:
28+
runner: ${{ inputs.runner }}
29+
parallel: ${{ inputs.parallel }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Run core Modin tests - group 1"
2+
description: "Run core Modin tests like dataframe or groupby"
3+
inputs:
4+
runner:
5+
description: "Runner for tests"
6+
default: "python -m pytest"
7+
parallel:
8+
description: "How to run tests in parallel"
9+
default: "-n 2"
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- run: |
15+
echo "::group::Running dataframe tests (group 1)..."
16+
${{ inputs.runner }} ${{ inputs.parallel }} modin/pandas/test/dataframe/test_binary.py \
17+
modin/pandas/test/dataframe/test_default.py \
18+
modin/pandas/test/dataframe/test_indexing.py \
19+
modin/pandas/test/dataframe/test_iter.py
20+
echo "::endgroup::"
21+
shell: bash -l {0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "Run core Modin tests - group 2"
2+
description: "Run core Modin tests like dataframe or groupby"
3+
inputs:
4+
runner:
5+
description: "Runner for tests"
6+
default: "python -m pytest"
7+
parallel:
8+
description: "How to run tests in parallel"
9+
default: "-n 2"
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- run: |
15+
echo "::group::Running dataframe tests (group 2)..."
16+
${{ inputs.runner }} ${{ inputs.parallel }} modin/pandas/test/dataframe/test_join_sort.py \
17+
modin/pandas/test/dataframe/test_reduce.py \
18+
modin/pandas/test/dataframe/test_udf.py \
19+
modin/pandas/test/dataframe/test_window.py \
20+
modin/pandas/test/dataframe/test_pickle.py
21+
echo "::endgroup::"
22+
shell: bash -l {0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Run core Modin tests - group 3"
2+
description: "Run core Modin tests like dataframe or groupby"
3+
inputs:
4+
runner:
5+
description: "Runner for tests"
6+
default: "python -m pytest"
7+
parallel:
8+
description: "How to run tests in parallel"
9+
default: "-n 2"
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- run: |
15+
echo "::group::Running tests (group 3)..."
16+
${{ inputs.runner }} ${{ inputs.parallel }} modin/pandas/test/test_series.py \
17+
modin/pandas/test/dataframe/test_map_metadata.py
18+
echo "::endgroup::"
19+
shell: bash -l {0}
20+
- run: |
21+
echo "::group::Running experimental groupby tests (group 3)..."
22+
MODIN_EXPERIMENTAL_GROUPBY=1 ${{ inputs.runner }} ${{ inputs.parallel }} modin/pandas/test/test_groupby.py
23+
echo "::endgroup::"
24+
shell: bash -l {0}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Run core Modin tests - group 4"
2+
description: "Run core Modin tests like dataframe or groupby"
3+
inputs:
4+
runner:
5+
description: "Runner for tests"
6+
default: "python -m pytest"
7+
parallel:
8+
description: "How to run tests in parallel"
9+
default: "-n 2"
10+
11+
runs:
12+
using: "composite"
13+
steps:
14+
- run: |
15+
echo "::group::Running tests (group 4)..."
16+
${{ inputs.runner }} ${{ inputs.parallel }} modin/pandas/test/test_rolling.py \
17+
modin/pandas/test/test_expanding.py \
18+
modin/pandas/test/test_groupby.py \
19+
modin/pandas/test/test_reshape.py \
20+
modin/pandas/test/test_general.py
21+
echo "::endgroup::"
22+
shell: bash -l {0}
23+
- run: |
24+
echo "::group::Running concat tests (group 4)..."
25+
${{ inputs.runner }} modin/pandas/test/test_concat.py # Ray and Dask versions fails with -n 2
26+
echo "::endgroup::"
27+
shell: bash -l {0}

0 commit comments

Comments
 (0)