CI-Ubuntu #442
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
# This is a basic workflow to help you get started with Actions | |
name: CI-Ubuntu | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ '*' ] | |
paths-ignore: # Don't trigger on files that are updated by the CI | |
- README.md | |
pull_request: | |
branches: [ '*' ] | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
# run at 02:01 on every 15th day-of-month. | |
- cron: '1 2 */15 * *' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, '3.10', '3.11'] | |
# unsupported version on ubuntu-latest 3.5, 3.6 | |
# see https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@main | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@main | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install the dependences | |
run: | | |
python -m pip install --upgrade pip | |
# install ubuntu package | |
sudo apt-get update | |
# need to add ghostscript explicitly (only 'recommanded' by imagemagick package) | |
# but 'libmagickwand-dev' is installed | |
sudo apt-get install ghostscript imagemagick | |
# move policy file | |
sudo mv /etc/ImageMagick-6/policy.xml /etc/ImageMagick-6/policy.xml.off | |
# texlive-fonts-recommended (bophook in texlive-latex-extra) required by moodle2amc test | |
sudo apt-get install texlive-latex-recommended texlive-pictures texlive-fonts-recommended texlive-latex-extra | |
# add libtext-unidecode-perl to fix bug in deb package : https://github.com/brucemiller/LaTeXML/issues/1022 | |
sudo apt-get install libtext-unidecode-perl | |
sudo apt-get install latexml | |
sudo apt-get install xmlindent | |
- name: Test latexml | |
run: | | |
# add --strict flag to be more strict in error catching | |
latexml --noparse --nocomment --strict --path=./amc2moodle/amc2moodle --dest=./out.xml ./amc2moodle/amc2moodle/test/QCM.tex | |
- name: Install amc2moodle | |
run: | | |
# add -e to have write access for test. TODO : change with temp file | |
pip install -e . | |
- name: Test amc2moodle | |
run: | | |
python -m amc2moodle.amc2moodle.test | |
- name: Test moodle2amc | |
run: | | |
# add automultiplechoice.sty local copy to LaTeX PATH (for this step) | |
export TEXINPUTS=.:./amc2moodle/moodle2amc/test:$TEXINPUTS | |
python -m amc2moodle.moodle2amc.test | |
- name: Test calculated questions parsers | |
run: | | |
python -m amc2moodle.utils.test | |
# Store output files | |
# amc2moodle | |
- name: Archive XML test output of amc2moodle (without tikz) | |
if: ${{ always() }} | |
uses: actions/upload-artifact@main | |
with: | |
name: test_notikz_${{ matrix.python-version }} | |
path: test_notikz.xml | |
- name: Archive XML test output of amc2moodle (with tikz) | |
if: ${{ always() }} | |
uses: actions/upload-artifact@main | |
with: | |
name: test_tikz_${{ matrix.python-version }} | |
path: test_tikz.xml | |
# moodle2amc | |
- name: Move latex output | |
if: ${{ always() }} | |
run: | | |
mkdir moodle-bank-exemple-output | |
mv test_moodle-bank-exemple.* moodle-bank-exemple-output/ | |
- name: Archive LaTeX test output (moodle2amc) | |
if: ${{ always() }} | |
uses: actions/upload-artifact@main | |
with: | |
name: test_moodle-bank-exemple_${{ matrix.python-version }} | |
path: moodle-bank-exemple-output | |
# - name: Archive . | |
# if: ${{ always() }} | |
# uses: actions/upload-artifact@v1 | |
# with: | |
# name: all_${{ matrix.python-version }} | |
# path: . | |