diff --git a/.github/actions/run-unit-tests.yml b/.github/actions/run-unit-tests.yml new file mode 100644 index 000000000..ab0e79fc8 --- /dev/null +++ b/.github/actions/run-unit-tests.yml @@ -0,0 +1,22 @@ +name: Unit Tests / Python ${{ inputs.python-version }} +inputs: + python-version: + required: true + default: '3.8' +runs: + using: 'composite' + steps: + - name: Check out the repository + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Set up Python ${{ inputs.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + - name: Install dependencies + run: | + python -m pip install --user --upgrade pip + python -m pip install .[test] + - name: Run unit tests + run: python -m pytest tests/unit diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index beef706a6..565afea2d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,24 +71,10 @@ jobs: python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - - name: Check out the repository - uses: actions/checkout@v3 - with: - persist-credentials: false - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - uses: actions/run-unit-tests with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --user --upgrade pip - python -m pip install .[test] - - - name: Run unit tests - run: python -m pytest tests/unit - - name: Get current date if: always() id: date