Skip to content

Reduce number of tests run, to reduce cache size. #11

Reduce number of tests run, to reduce cache size.

Reduce number of tests run, to reduce cache size. #11

Workflow file for this run

# This workflow will install Python dependencies, run tests using tox
name: Simple Tox Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
steps:
# Clean out runner data we don't use, should free up ~15 GB
- name: "Make space on runner by removing tools we don't need using rmz, a fast version of rm."
run: |
df -h
DOWNLOAD_URL="https://github.com/SUPERCILEX/fuc/releases/download/3.1.1/x86_64-unknown-linux-gnu-rmz"
curl --location --output rmz "$DOWNLOAD_URL"
chmod +x rmz
sudo mv rmz /usr/bin/rmz
rmz --version
sudo rmz --force \
/usr/local/lib/android \
/opt/ghc \
"${HOME}/.rustup" \
"${HOME}/.cargo" \
"${HOME}/.dotnet" \
/opt/containerd \
/opt/hostedtoolcache \
/opt/microsoft \
/opt/az \
/opt/pipx* \
/opt/google \
/opt/mssql-tools || true
df -h
- uses: actions/checkout@v4
# https://github.com/actions/cache?tab=readme-ov-file
- name: Restore tox dir cache and saves after run
id: restore-tox
uses: actions/cache@v4
env:
cache-name: cache-tox-data
with:
path: .tox
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('pyproject.toml', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- name: Install python dependencies
run: |
python -m pip install tox
- name: Run ruff format check (<50M)
run: |
tox -e ruff_checkformat
- name: Run ruff check (<50M)
run: |
tox -e ruff_check
- name: Fetch dataset (175M)
run: |
tox -e trainingdata
- name: Run tox unit tests (6G)
run: |
tox -e py310
- name: Run tox security check (<50M)
run: |
tox -e bandit
- name: Run inference
run: |
tox -e inference_CI
# Keeping this makes our cache ~7G, causing it to be evicted often. Rather caching pip, so this goes OK fast.
- name: Don't cache inference_CI tox dir
run: rmz --force .tox/inference_CI
- name: Run inference_multi_CI
run: |
tox -e inference_multi_CI
# Keeping this makes our cache ~7G, causing it to be evicted often. Rather caching pip, so this goes OK fast.
- name: Don't cache inference_multi_CI tox dir
run: rmz --force .tox/inference_multi_CI
# Show disk usage
- run: df -h
- run: du -hsc .tox ~/.cache/pip