Add new test environment for Anki 23.12.1 #189
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-ignore: | |
- update-test-environment/* | |
tags: | |
- '**' | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
run-tests: | |
name: ${{ matrix.name }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- name: Anki 2.1.49 | |
python: 3.8 | |
environment: py38-anki2.1.49 | |
- name: Anki 2.1.51 (Qt5) | |
python: 3.9 | |
environment: py39-anki2.1.51-qt5 | |
- name: Anki 2.1.51 (Qt6) | |
python: 3.9 | |
environment: py39-anki2.1.51-qt6 | |
- name: Anki 2.1.52 (Qt5) | |
python: 3.9 | |
environment: py39-anki2.1.52-qt5 | |
- name: Anki 2.1.52 (Qt6) | |
python: 3.9 | |
environment: py39-anki2.1.52-qt6 | |
- name: Anki 2.1.53 (Qt5) | |
python: 3.9 | |
environment: py39-anki2.1.53-qt5 | |
- name: Anki 2.1.53 (Qt6) | |
python: 3.9 | |
environment: py39-anki2.1.53-qt6 | |
- name: Anki 2.1.54 (Qt5) | |
python: 3.9 | |
environment: py39-anki2.1.54-qt5 | |
- name: Anki 2.1.54 (Qt6) | |
python: 3.9 | |
environment: py39-anki2.1.54-qt6 | |
- name: Anki 23.10.1 (Qt5) | |
python: 3.9 | |
environment: py39-anki23.10.1-qt5 | |
- name: Anki 23.10.1 (Qt6) | |
python: 3.9 | |
environment: py39-anki23.10.1-qt6 | |
- name: Pre-release (2.1.53rc1) | |
python: 3.9 | |
environment: py39-pre-anki2.1.53rc1-qt6 | |
fail-fast: false | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y pyqt5-dev-tools xvfb jq | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install tox | |
run: pip install tox | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Run tests | |
run: tox -vvve ${{ matrix.environment }} -- --forked --verbose | |
assemble-ankiaddon: | |
name: Assemble .ankiaddon | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [run-tests] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
# https://github.com/actions/checkout/issues/290 | |
- name: Fetch tag annotations | |
run: git fetch --tags --force | |
- name: Assemble the add-on | |
run: | | |
version="$(git describe --long)" | |
cd anki_wallpaper | |
sed -i -r "s/# Wallpaper/\0 <version>$version<\/version>/" config.md | |
zip -r ../anki-wallpaper.ankiaddon * | |
echo ASSET_NAME="anki-wallpaper-$version.ankiaddon" >> "$GITHUB_ENV" | |
- name: Store artifact | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
tag: ${{ github.ref }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: anki-wallpaper.ankiaddon | |
asset_name: ${{ env.ASSET_NAME }} |