Add extensions support and first extension. #201
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: BamBam | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
- name: Lint with flake8 | |
run: | | |
flake8 . --show-source --statistics | |
- name: Lint with autopep8 | |
run: | | |
autopep8 -d *.py | awk 'BEGIN{had_data=0}{print;had_data=1}END{exit had_data}' | |
- name: Run unit tests | |
run: | | |
python -m unittest *_test.py | |
e2e: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
extension-arg: ["", "--extension=alphanumeric-en_US"] | |
env: | |
AUTOPKGTEST_TMP: /tmp | |
AUTOPKGTEST_BAMBAM_PROGRAM: ./bambam.py | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
- name: Install GUI packages | |
run: | | |
sudo apt-get install -y xvfb xauth imagemagick xdotool sox | |
- name: Run regular GUI tests | |
run: ./run_e2e_test.sh regular -- ${{ matrix.extension-arg }} | |
- name: Run GUI tests in dark mode | |
run: ./run_e2e_test.sh dark --no-expect-light-mode -- --dark ${{ matrix.extension-arg }} | |
- name: Run GUI tests with deterministic sounds | |
run: ./run_e2e_test.sh deterministic -- --deterministic-sounds ${{ matrix.extension-arg }} | |
- name: Run GUI tests muted | |
run: ./run_e2e_test.sh muted --no-expect-sounds -- --mute ${{ matrix.extension-arg }} | |
- name: Run GUI tests muted just initially | |
run: ./run_e2e_test.sh start-muted -- --mute ${{ matrix.extension-arg }} | |
- name: Run GUI tests without sound support | |
run: ./run_e2e_test.sh no-audio --no-expect-audio-output --sdl-audio-driver invalid ${{ matrix.extension-arg }} | |
- name: Save artifacts | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: test-artifacts-${{ matrix.python-version }}-arg${{ matrix.extension-arg }} | |
path: artifacts | |
nofonts: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11"] # Just latest to keep number of combinations down. | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
- name: Install GUI packages | |
run: | | |
sudo apt-get install -y xvfb xauth | |
- name: Run test for font absence | |
run: | | |
export AUTOPKGTEST_ARTIFACTS=`pwd`/artifacts | |
mkdir -p $AUTOPKGTEST_ARTIFACTS | |
export AUTOPKGTEST_TMP=/tmp | |
# Prepare permissions for deleting freetype. | |
for lib in $(./test/find-freetype.sh echo); do | |
dir="$(dirname "${lib}")" | |
echo "Granting write permission on ${dir}" >&2 | |
sudo chmod a+w "${dir}" | |
done | |
xvfb-run \ | |
-e $AUTOPKGTEST_ARTIFACTS/xvfb-run.stderr \ | |
-s "-screen 0 1024x768x24 -fbdir $AUTOPKGTEST_TMP" \ | |
./test/find-freetype.sh rm-and-run \ | |
timeout -v -k 5 10 \ | |
./test/redirect-stderr-and-run.sh errors.txt ./bambam.py || echo Bambam under xvfb exited code $? | |
if grep -q 'Error, pygame fonts not available.' errors.txt; then | |
echo "Expected font absence message found." | |
exit 0 | |
fi | |
echo "Expected font absence message not found." | |
cat errors.txt | |
exit 1 |