1name: Source Distribution Test
2
3on:
4  push:
5  pull_request:
6  schedule:
7    - cron: '0 0 * * 0' # weekly
8
9env:
10  JOBS: 2
11  DEPS: libgmp-dev libmpfr-dev libqd-dev libtool autoconf python3-pip python3-dev python3-flake8
12
13jobs:
14  build:
15    runs-on: ubuntu-latest
16    strategy:
17      matrix:
18        python-version: [3.6, 3.8]
19        have_qd: [yes, no]
20        have_numpy: [yes, no]
21
22    env:
23        HAVE_QD: ${{ matrix.have_qd }}
24        HAVE_NUMPY: ${{ matrix.have_numpy }}
25
26    steps:
27      - name: Set up Python ${{ matrix.python-version }}
28        uses: actions/setup-python@v2
29        with:
30          python-version: ${{ matrix.python-version }}
31
32      - name: Check out
33        uses: actions/checkout@v2
34      - name: Install prerequisites
35        run: |
36          sudo DEBIAN_FRONTEND=noninteractive apt-get update
37          sudo DEBIAN_FRONTEND=noninteractive apt-get install $DEPS
38
39      - name: Dependencies
40        run: |
41          git clone https://github.com/fplll/fplll
42          cd fplll || exit
43          ./autogen.sh
44          ./configure --disable-static --prefix=/usr --with-max-enum-dim=64 --with-max-parallel-enum-dim=20
45          make -j $JOBS
46          sudo make install
47          cd ..
48
49          pip install Cython
50          pip install -r requirements.txt
51          pip install -r suggestions.txt
52          cd ..
53
54          rm -rf ./fplll
55
56      - name: Compile
57        run: |
58          python setup.py sdist
59          cd dist
60          tar xvfz fpylll-*.tar.gz
61          cd $(ls -1 *.tar.gz | sed s/\.tar\.gz//)
62          python setup.py build_ext -j $JOBS
63          python setup.py install
64
65      - name: Test
66        run: PY_IGNORE_IMPORTMISMATCH=1 python -m pytest
67