Skip to content

Commit

Permalink
Simplify the test-suite infrastructure in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pi8027 committed May 28, 2024
1 parent 1b3a1d2 commit 2ef95dc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 21 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/docker-action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file was generated from `meta.yml` using the coq-community templates and
# then patched to support the test-suite. Be careful when regenerating it.
# This file was generated from `meta.yml`, please do not edit manually.
# Follow the instructions on https://github.com/coq-community/templates to regenerate.
name: Docker CI

on:
Expand Down Expand Up @@ -38,15 +38,9 @@ jobs:
with:
opam_file: 'coq-mathcomp-algebra-tactics.opam'
custom_image: ${{ matrix.image }}
after_script: |
startGroup "Run tests"
sudo chown -R coq:coq .
make test-suite TEST_SKIP_BUILD=1
endGroup
- name: Revert permissions
if: ${{ always() }}
run: sudo chown -R 1001:116 .

export: 'OPAMWITHTEST'
env:
OPAMWITHTEST: true

# See also:
# https://github.com/coq-community/docker-coq-action#readme
Expand Down
1 change: 1 addition & 0 deletions Make.test-suite
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ examples/ring_examples_no_check.v
examples/from_sander.v
examples/lra_examples.v

-R theories mathcomp.algebra_tactics
-R examples mathcomp.algebra_tactics.examples
-arg -w -arg -notation-overridden
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ KNOWNFILES := Makefile Make Make.test-suite

.DEFAULT_GOAL := invoke-coqmakefile

ifneq "$(TEST_SKIP_BUILD)" ""
TEST_DEP :=
LIBRARY_PATH :=
else
TEST_DEP := invoke-coqmakefile
LIBRARY_PATH := -R theories mathcomp.algebra_tactics
endif

COQMAKEFILE = $(COQBIN)coq_makefile
COQMAKE = $(MAKE) --no-print-directory -f Makefile.coq
COQMAKE_TESTSUITE = $(MAKE) --no-print-directory -f Makefile.test-suite.coq
Expand All @@ -25,12 +17,12 @@ Makefile.coq: Makefile Make
$(COQMAKEFILE) -f Make -o Makefile.coq

Makefile.test-suite.coq: Makefile Make.test-suite
$(COQMAKEFILE) -f Make.test-suite $(LIBRARY_PATH) -o Makefile.test-suite.coq
$(COQMAKEFILE) -f Make.test-suite -o Makefile.test-suite.coq

invoke-coqmakefile: Makefile.coq
$(COQMAKE) $(filter-out $(KNOWNTARGETS),$(MAKECMDGOALS))

test-suite: Makefile.test-suite.coq $(TEST_DEP)
test-suite: Makefile.test-suite.coq invoke-coqmakefile
$(COQMAKE_TESTSUITE)

theories/%.vo: Makefile.coq
Expand Down
1 change: 1 addition & 0 deletions coq-mathcomp-algebra-tactics.opam
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ automatically push down ring morphisms and additive functions to leaves of
ring/field expressions before applying the proof procedures."""

build: [make "-j%{jobs}%"]
run-test: [make "-j%{jobs}%" "test-suite"]
install: [make "install"]
depends: [
"coq" {>= "8.16"}
Expand Down
6 changes: 6 additions & 0 deletions meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,14 @@ dependencies:
description: |-
[Coq-Elpi](https://github.com/LPCIC/coq-elpi) 1.15.0 or later (known not to work with 1.17.0)
test_target: test-suite
namespace: mathcomp.algebra_tactics

action_appendix: |2-
export: 'OPAMWITHTEST'
env:
OPAMWITHTEST: true
documentation: |-
## Documentation
Expand Down

0 comments on commit 2ef95dc

Please sign in to comment.