v0.5.8 #214
Workflow file for this run
This file contains 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
# Ref: https://mckornfield.medium.com/caching-python-installs-in-github-actions-8309e12a15e6 | |
# Ref: https://github.com/keras-team/keras-cv/blob/master/.github/workflows/actions.yml | |
name: Tests | |
env: | |
PYTHON_VERSION: '3.8' | |
TF_VERSION: '2.13.0' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
release: | |
types: [created] | |
jobs: | |
format: | |
name: Check the code format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Cache virtualenv | |
uses: actions/cache@v3 | |
id: cache-venv | |
with: | |
path: ./.venv/ | |
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-venv-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-venv- | |
- name: Install dependencies | |
shell: bash | |
run: | | |
python -m venv ./.venv | |
source ./.venv/bin/activate | |
pip install --upgrade pip setuptools | |
pip install tensorflow-cpu==${{ env.TF_VERSION }} | |
pip install -e ".[tests]" --progress-bar off --upgrade | |
if: steps.cache-venv.outputs.cache-hit != 'true' | |
- name: Lint | |
shell: bash | |
run: | | |
source ./.venv/bin/activate | |
bash shell/lint.sh | |
test: | |
needs: format | |
name: Test the code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v4 | |
id: setup-python | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Cache virtualenv | |
uses: actions/cache@v3 | |
id: cache-venv | |
with: | |
path: ./.venv/ | |
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-venv-${{ hashFiles('pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-venv- | |
- name: Install dependencies | |
shell: bash | |
run: | | |
python -m venv ./.venv | |
source ./.venv/bin/activate | |
pip install tensorflow-cpu==${{ env.TF_VERSION }} | |
pip install -e ".[tests]" --progress-bar off --upgrade | |
if: steps.cache-venv.outputs.cache-hit != 'true' | |
- name: Test with pytest | |
shell: bash | |
run: | | |
source ./.venv/bin/activate | |
pytest keras_aug/ | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |