update workflow on which docs pr preview depends (#141) #115
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
name: models | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
pull_request: | |
branches: [main] | |
jobs: | |
tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: [3.9] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Ubuntu packages | |
run: | | |
sudo apt-get update -y | |
- name: Install and upgrade python packages | |
run: | | |
python -m pip install --upgrade pip setuptools==59.4.0 wheel tox | |
- name: Run unittests | |
run: | | |
ref_type=${{ github.ref_type }} | |
branch=main | |
if [[ $ref_type == "tag"* ]] | |
then | |
raw=$(git branch -r --contains ${{ github.ref_name }}) | |
branch=${raw/origin\/} | |
fi | |
GIT_COMMIT=`git rev-parse HEAD` tox -e test-models-cpu -- $branch |