fix: add dependency installation step for ubuntu runners needed for pygame version bump #235
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: run_coverage | |
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 | |
workflow_call: | |
inputs: | |
ref: | |
description: Git ref on which to run the tests. | |
type: string | |
jobs: | |
coverage: | |
strategy: | |
fail-fast: true | |
matrix: | |
python-version: ["3.11"] | |
os: [ubuntu-latest] | |
extras: ["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 xvfb libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev libpng-dev | |
- name: Start Xvfb | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
Xvfb :99 -screen 0 1024x768x16 & | |
export DISPLAY=:99 | |
- name: Install Scenic and dependencies | |
run: | | |
python -m pip install -e ".[${{ matrix.extras }}]" | |
- name: Run and report code coverage | |
run: | | |
pytest tests/simulators/newtonian/test_newtonian.py --cov --cov-report json | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: BerkeleyLearnVerify/Scenic |