-
Notifications
You must be signed in to change notification settings - Fork 8
116 lines (97 loc) · 3.67 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
115
116
# 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.10']
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@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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
- 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: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
- 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@v4
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@v4
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@v1
with:
name: test_moodle-bank-exemple_${{ matrix.python-version }}
path: moodle-bank-exemple-output