fix: add dependency installation step for ubuntu runners needed for pygame version bump #541
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: tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: Git ref on which to run the tests. | |
type: string | |
required: true | |
options: | |
description: Options to pass to pytest. | |
default: --no-graphics | |
type: string | |
workflow_call: | |
inputs: | |
ref: | |
description: Git ref on which to run the tests. | |
type: string | |
options: | |
description: Options to pass to pytest. | |
default: --no-graphics | |
type: string | |
jobs: | |
check-format: | |
uses: ./.github/workflows/check-formatting.yml | |
test: | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
os: [ubuntu-latest, windows-latest] | |
extras: ["test", "test-full"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout given ref | |
uses: actions/checkout@v3 | |
if: inputs.ref != '' | |
with: | |
ref: ${{ inputs.ref }} | |
- name: Checkout current branch | |
uses: actions/checkout@v3 | |
if: inputs.ref == '' | |
with: | |
ref: ${{ github.ref }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Update pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install Dependencies | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev libpng-dev | |
export PYGAME_DETECT_AVX2=1 | |
- name: Install Scenic and dependencies | |
run: | | |
python -m pip install -e ".[${{ matrix.extras }}]" | |
- name: Run pytest | |
run: | | |
pytest ${{ inputs.options || '--no-graphics' }} |