|
| 1 | +name: Docker CI |
| 2 | + |
1 | 3 | on: [push, pull_request]
|
2 | 4 |
|
3 | 5 | jobs:
|
|
6 | 8 | strategy:
|
7 | 9 | matrix:
|
8 | 10 | image:
|
9 |
| - - mathcomp/mathcomp:1.12.0-coq-8.10 |
10 |
| - - mathcomp/mathcomp:1.12.0-coq-8.11 |
11 |
| - - mathcomp/mathcomp:1.12.0-coq-8.12 |
| 11 | + - mathcomp/mathcomp:1.12.0-coq-8.10 |
| 12 | + - mathcomp/mathcomp:1.12.0-coq-8.11 |
| 13 | + - mathcomp/mathcomp:1.12.0-coq-8.12 # 8.12.1+ support ocaml/dune#3210 |
| 14 | + - coqorg/coq:8.13-native-ocaml-4.07 # with the coq-native opam pkg |
| 15 | + - coqorg/coq:8.14-native-ocaml-4.07 # with the coq-native opam pkg |
| 16 | + - mathcomp/mathcomp:1.12.0-coq-8.13 # (without coq-native for now) |
| 17 | + - mathcomp/mathcomp:1.12.0-coq-8.14 # (without coq-native for now) |
| 18 | + # the previous comments refer to https://github.com/coq/ceps/pull/48 |
12 | 19 | fail-fast: false
|
13 | 20 | steps:
|
14 |
| - - uses: actions/checkout@v2 |
15 |
| - - uses: coq-community/docker-coq-action@v1 |
16 |
| - with: |
17 |
| - custom_image: ${{ matrix.image }} |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + - uses: coq-community/docker-coq-action@v1 |
| 23 | + env: |
| 24 | + LIBRARY_NAME: 'SsrMultinomials' |
| 25 | + ROOT_THEORIES: 'mpoly monalg' |
| 26 | + with: |
| 27 | + opam_file: 'coq-mathcomp-multinomials.opam' |
| 28 | + custom_image: ${{ matrix.image }} |
| 29 | + export: 'LIBRARY_NAME ROOT_THEORIES' |
| 30 | + # Note: these native-compiler tests are generic, |
| 31 | + # thanks to env variables & the configure script |
| 32 | + after_script: | |
| 33 | + startGroup "Print native_compiler status" |
| 34 | + coqc -config |
| 35 | + . configure # sourcing mandatory |
| 36 | + coq_version |
| 37 | + endGroup |
| 38 | + # Note: Replace with "if coq_native_compiler" |
| 39 | + # to also test with Coq 8.12.1+ |
| 40 | + if coq_native_compiler_default; then |
| 41 | + startGroup "Workaround permission issue" |
| 42 | + sudo chown -R coq:coq . # <--(§) |
| 43 | + endGroup |
| 44 | + startGroup "Check native_compiler on a test file" |
| 45 | + printf '%s\n' "From $LIBRARY_NAME Require Import $ROOT_THEORIES." > test.v |
| 46 | + coqc -debug -native-compiler yes test.v > stdout.txt || ret=$? |
| 47 | + cat stdout.txt |
| 48 | + ( exit "${ret:-0}" ) |
| 49 | + endGroup |
| 50 | + # in practice, we get ret=0 even if deps were not native-compiled |
| 51 | + # but the logs are useful...(*), so we keep this first test group |
| 52 | + # and add another test group which is less verbose, but stricter. |
| 53 | + startGroup "Check installation of .coq-native/ files" |
| 54 | + set -o pipefail |
| 55 | + # fail noisily if ever 'find' gives 'No such file or directory' |
| 56 | + num=$(find "$(coqc -where)/user-contrib/$LIBRARY_NAME" -type d -name ".coq-native" | wc -l) |
| 57 | + [ "$num" -gt 0 ] |
| 58 | + endGroup |
| 59 | + fi |
| 60 | + - name: Revert permissions |
| 61 | + # to avoid a warning at cleanup time |
| 62 | + if: ${{ always() }} |
| 63 | + run: sudo chown -R 1001:116 . # <--(§) |
| 64 | + |
| 65 | +#(§)=> https://github.com/coq-community/docker-coq-action#permissions |
| 66 | +#(*)=> Cannot find native compiler file /home/coq/.opam/4.07.1/lib/coq/user-contrib/SsrMultinomials/.coq-native/NSsrMultinomials_ssrcomplements.cmxs |
0 commit comments