diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 52ada6e2..9b1417cb 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -22,20 +22,46 @@ jobs: steps: - - uses: actions/setup-python@v2 + - name: Setup Python + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - run: python -m pip install --upgrade pip - - uses: actions/checkout@v2 + - name: Upgrade pip + run: python -m pip install --upgrade pip - - run: python -m pip install .[test,docs] + - name: Checkout code + uses: actions/checkout@v2 - - run: python -m pytest ./testing/ --cov=idelib --cov-report=xml -n auto - - run: sphinx-build -W -b html docs docs/html - - run: sphinx-build -W -b doctest docs docs/doctest + - name: Get pip Cache Location + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" - - uses: codecov/codecov-action@v2 + - name: Get Date + id: get-date + run: echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")" + shell: bash + + - name: Setup pip Cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}-pip-${{ hashFiles('**/setup.py') }} + + - name: Install package & (test) dependencies + run: python -m pip install .[test,docs] + + - name: Run Unit Tests + run: python -m pytest ./testing/ --cov=idelib --cov-report=xml -n auto + + - name: Run Docs test + run: sphinx-build -W -b html ./docs/source ./docs/html + + - name: Run Docstring Tests + run: sphinx-build -W -b doctest ./docs/source ./docs/doctest + + - name: Generate Codecov Report + uses: codecov/codecov-action@v2 with: token: ${{ secrets.CODECOV_TOKEN }} env_vars: OS,PYTHON-VERSION