-
Notifications
You must be signed in to change notification settings - Fork 8
114 lines (97 loc) · 4.04 KB
/
ci-mac-os.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# This is a basic workflow to help you get started with Actions
name: CI-mac-os
# 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: macos-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
env:
# set env variable for Wand
MAGICK_HOME: "/opt/homebrew"
# 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 LaTeXML dependences
run: |
python -m pip install --upgrade pip
# Install requirements for lateXML
brew update
brew install imagemagick
brew install --cask basictex
brew install latexml
- name: Update $PATH
# run: echo ::add-path::/Library/TeX/texbin # depreciated
run: echo "/Library/TeX/texbin" >> $GITHUB_PATH
- name: Add fonts (required by moodle2amc tests)
run: |
# xstring is just required for testing --includestyles
sudo tlmgr update --self
sudo tlmgr install collection-fontsrecommended bophook xstring --verify-repo=none
- 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/tests/payload_test_amc2moodle/QCM.tex
- name: Install amc2moodle
run: |
# add -e to have write access for test. TODO : change with temp file
pip install -e .[test]
- name: Test amc2moodle
run: |
pytest --pyargs amc2moodle.tests.test_amc2moodle
- name: Test moodle2amc
run: |
# add automultiplechoice.sty local copy to LaTeX PATH (for this step)
# export TEXINPUTS=.:./tests/payload_test_amc2moodle/:$TEXINPUTS (during tests, automultiplechoice.sty is copied in the temporary test folder )
pytest --pyargs amc2moodle.tests.test_moodle2amc
- name: Test text parser
run: |
pytest --pyargs amc2moodle.tests.test_utils_text
- name: Test calculated questions parsers
run: |
pytest --pyargs amc2moodle.tests.test_utils_calculatedParser
# 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: output_tests/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: output_tests/test_tikz.xml
# moodle2amc
- name: Move latex output
if: ${{ always() }}
run: |
mkdir moodle-bank-exemple-output
mv output_tests/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