Skip to content

Commit

Permalink
update CI: Save resource & add format check (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
butterunderflow authored Aug 1, 2024
2 parents 50be34b + 434d3f5 commit 4523e41
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 22 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Make sure there's only one ci triggerd for a non-master branch
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Expand Down Expand Up @@ -48,12 +51,14 @@ jobs:
run: opam install menhir

- name: "Install OPAM dependencies"
run: opam install . --deps-only

run: opam install . --deps-only

- name: "Build whole project"
run: opam exec -- dune build

- name: "Check format"
run: opam exec -- dune build @fmt

- name: Run tests
run: opam exec -- dune runtest

Expand All @@ -64,4 +69,4 @@ jobs:
opam exec -- bisect-ppx-report summary --per-file --coverage-path=$BISECT_DIR >> $GITHUB_STEP_SUMMARY
env:
BISECT_DIR: ${{ runner.temp }}/_coverage
BISECT_FILE: ${{ runner.temp }}/_coverage/bisect_data
BISECT_FILE: ${{ runner.temp }}/_coverage/bisect_data
3 changes: 2 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
qcheck
qcheck-alcotest
bisect_ppx
lwt))
lwt
ocamlformat))

(generate_opam_files)

Expand Down
1 change: 1 addition & 0 deletions fun4fun.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ depends: [
"qcheck-alcotest"
"bisect_ppx"
"lwt"
"ocamlformat"
"odoc" {with-doc}
]
build: [
Expand Down
16 changes: 8 additions & 8 deletions lib/syntax/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
(modules parser)
(flags --explain --inspection --table --dump))


;; -----------------------------------------------------------------------------

;; This section deals with the .messages file.
Expand All @@ -21,10 +20,11 @@
;; performed first. (If desired, this check could be disabled.)

(rule
(action (with-stdout-to parserMessages.ml
(run menhir
%{dep:parser.mly}
--compile-errors %{dep:parserMessages.messages}
)
))
)
(action
(with-stdout-to
parserMessages.ml
(run
menhir
%{dep:parser.mly}
--compile-errors
%{dep:parserMessages.messages}))))
12 changes: 6 additions & 6 deletions tests/cram/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
(cram
(applies_to :whole_subtree)
(deps
%{bin:ff}
%{bin:ff_wrapper}
%{lib-private:runtime:libfun_rt.a}
%{lib-private:runtime:fun_rt.hpp}
%{lib-private:runtime:fun_rt_core.hpp}
%{lib-private:runtime:fun_rt_lib.hpp}))
%{bin:ff}
%{bin:ff_wrapper}
%{lib-private:runtime:libfun_rt.a}
%{lib-private:runtime:fun_rt.hpp}
%{lib-private:runtime:fun_rt_core.hpp}
%{lib-private:runtime:fun_rt_lib.hpp}))
3 changes: 2 additions & 1 deletion tests/regular/syntax_error_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ let%expect_test "Error reporting syntax error test" =
let 3 = 2
|};
[%expect {|
[%expect
{|
File "*test*", line 6, characters 24-25:
Syntax error after 'let' and before '3'.
(Curated message for this state is not supported)!
Expand Down
2 changes: 1 addition & 1 deletion tests/regular/typing_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ module L2 = (K: M)
(TVarI (Link (TConsI (0 string) ()))))))))
|}];

print_typed {|
print_typed {|
let _ = 1

let result = _
Expand Down

0 comments on commit 4523e41

Please sign in to comment.