Skip to content

Commit

Permalink
Add build time check to CI (#96)
Browse files Browse the repository at this point in the history
* Add build time check to CI

* Increase cache prefix

* Fix CI

* Fix CI, really

* Optimize a tactic
  • Loading branch information
Ailrun authored Jun 3, 2024
1 parent f8feff0 commit 22c9055
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
ocaml-compiler: ${{ env.OCAML_VER }}
dune-cache: true
cache-prefix: "v2"
cache-prefix: "v2.1"
- name: install Menhir and Coq
run: |
opam update
Expand All @@ -55,7 +55,7 @@ jobs:
run: |
eval $(opam env)
cd theories/
make -j ${{ steps.cpu-cores.outputs.count }}
make -j ${{ steps.cpu-cores.outputs.count }} pretty-timed
- name: test parser
run: |
eval $(opam env)
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@ theories/**/Parser.v
*.vos
.lia.cache
CoqMakefile.mk*
!CoqMakefile.mk.local
!CoqMakefile.mk.local-late
*.log

# Editor related
## Emacs
*.~undo-tree~
29 changes: 29 additions & 0 deletions theories/CoqMakefile.mk.local-late
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
empty :=
space := $(empty) $(empty)

MENHIR := menhir

COQMAKEFILE := CoqMakefile.mk
COQPROJECTFILE := _CoqProject
PARSERBASE := parser.ml
PARSERFILE := ../driver/$(PARSERBASE)
PARSEREXTRACTIONDIR := Frontend
PARSEREXTRACTIONCOQFILE := $(PARSEREXTRACTIONDIR)/ParserExtraction.v
PARSEREXTRACTIONRESULTFILE := $(PARSEREXTRACTIONDIR)/$(PARSERBASE)
COQPARSERFILE := $(patsubst %.vy,%.v,$(shell find ./ -name '*.vy'))
COQFILES := $(sort $(shell find ./ -name '*.v') $(COQPARSERFILE))

post-all:: $(COQPARSERFILE)
@+$(MAKE) "$(PARSERFILE)"

$(COQPARSERFILE): %.v : %.vy
$(MENHIR) --coq "$?"

$(PARSERBASE): $(PARSEREXTRACTIONCOQFILE)
@+$(MAKE) -f "$(COQMAKEFILE)" -B "$(patsubst %.v,%.vo,$?)"

$(PARSERFILE): $(PARSEREXTRACTIONCOQFILE)
@+$(MAKE) "$(PARSERBASE)"
@echo "MOVE $(PARSERBASE) => $@"
@mv "$(PARSERBASE)" "$@"
@mv "$(patsubst %.ml,%.mli,$(PARSERBASE))" "$(patsubst %.ml,%.mli,$@)"
7 changes: 6 additions & 1 deletion theories/Core/Semantic/PER/Lemmas.v
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,12 @@ Ltac clear_relation_equivalence :=
(unify R1 R2; clear H) + (is_var R1; clear R1 H) + (is_var R2; clear R2 H)
end.

Ltac apply_relation_equivalence := rewrite_relation_equivalence_right; clear_relation_equivalence; rewrite_relation_equivalence_left; clear_relation_equivalence.
Ltac apply_relation_equivalence :=
clear_relation_equivalence;
rewrite_relation_equivalence_right;
clear_relation_equivalence;
rewrite_relation_equivalence_left;
clear_relation_equivalence.

Lemma per_univ_elem_right_irrel : forall i i' R a b R' b',
{{ DF a ≈ b ∈ per_univ_elem i ↘ R }} ->
Expand Down
17 changes: 2 additions & 15 deletions theories/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ COQPARSERFILE := $(patsubst %.vy,%.v,$(shell find ./ -name '*.vy'))
COQFILES := $(sort $(shell find ./ -name '*.v') $(COQPARSERFILE))

.PHONY: all
all: $(COQMAKEFILE) $(COQPARSERFILE)
all: $(COQMAKEFILE)
@+$(MAKE) -f "$(COQMAKEFILE)" all
@+$(MAKE) "$(PARSERFILE)"

.PHONY: clean
clean: $(COQMAKEFILE)
Expand All @@ -28,7 +27,7 @@ clean: $(COQMAKEFILE)
update_CoqProject: clean
(echo "-R . Mcltt"; \
echo ""; \
echo "-arg -w -arg -notation-overridden"; \
echo "-arg -w -arg -cast-in-pattern,-notation-overridden"; \
echo ""; \
echo -e "$(subst $(space),\n,$(COQFILES))") > "$(COQPROJECTFILE)"

Expand All @@ -38,19 +37,7 @@ force: ;
$(COQMAKEFILE): $(COQPROJECTFILE)
$(COQBIN)coq_makefile -f "$?" -o "$@"

$(COQPARSERFILE): %.v : %.vy
$(MENHIR) --coq "$?"

$(COQPROJECTFILE): ;

$(PARSERBASE): $(PARSEREXTRACTIONCOQFILE)
@+$(MAKE) -f "$(COQMAKEFILE)" -B "$(patsubst %.v,%.vo,$?)"

$(PARSERFILE): $(PARSEREXTRACTIONCOQFILE)
@+$(MAKE) "$(PARSERBASE)"
@echo "MOVE $(PARSERBASE) => $@"
@mv "$(PARSERBASE)" "$@"
@mv "$(patsubst %.ml,%.mli,$(PARSERBASE))" "$(patsubst %.ml,%.mli,$@)"

%: $(COQMAKEFILE) force
@+$(MAKE) -f "$(COQMAKEFILE)" "$@"

0 comments on commit 22c9055

Please sign in to comment.