Skip to content

Commit

Permalink
Bump dependencies to follow Topiary v0.2.0 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Niols authored May 22, 2023
2 parents 738416e + 6a5ce86 commit 04104df
Show file tree
Hide file tree
Showing 2,929 changed files with 1,119,453 additions and 599,142 deletions.
11 changes: 10 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[source.crates-io]
replace-with = "vendored-sources"

[source."git+https://github.com/nickel-lang/tree-sitter-nickel"]
[source."git+https://github.com/nickel-lang/tree-sitter-nickel?rev=cf1c52a53a527505515add41da90f8a575798987"]
git = "https://github.com/nickel-lang/tree-sitter-nickel"
rev = "cf1c52a53a527505515add41da90f8a575798987"
replace-with = "vendored-sources"

[source."git+https://github.com/nvim-treesitter/tree-sitter-query"]
Expand All @@ -17,5 +18,13 @@ replace-with = "vendored-sources"
git = "https://github.com/tree-sitter/tree-sitter-ocaml"
replace-with = "vendored-sources"

[source."git+https://github.com/tweag/tree-sitter-facade"]
git = "https://github.com/tweag/tree-sitter-facade"
replace-with = "vendored-sources"

[source."git+https://github.com/tweag/web-tree-sitter-sys"]
git = "https://github.com/tweag/web-tree-sitter-sys"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
36 changes: 36 additions & 0 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---

inputs:
topiary:
description: 'What `topiary` command to test'
samples:
description: 'Path to the test samples'

runs:
using: composite

steps:
- name: Run a smoke test
shell: bash
run: |
## Run a tiny smoke test; checking that Topiary manages to start,
## parse a simple OCaml command and output the right thing.
echo 'open Foo' > expected.ml
echo 'open Foo' \
| ${{ inputs.topiary }} --language ocaml \
> result.ml
diff expected.ml result.ml
- name: Run proper tests
shell: bash
run: |
## Test on OCaml implementation files (.ml)
cat ${{ inputs.samples }}/input/ocaml.ml \
| ${{ inputs.topiary }} --language ocaml-implementation \
> ocaml.ml
diff ${{ inputs.samples }}/expected/ocaml.ml ocaml.ml
## Test on OCaml interface files (.mli)
cat ${{ inputs.samples }}/input/ocaml.mli \
| ${{ inputs.topiary }} --language ocaml-interface \
> ocaml.mli
diff ${{ inputs.samples }}/expected/ocaml.mli ocaml.mli
59 changes: 14 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true

## Set up OCaml, pin Topiay and install its system dependencies.

Expand Down Expand Up @@ -100,27 +102,12 @@ jobs:
step-outcome: ${{ steps.install-topiary.outcome }}
expected-failure: ${{ matrix.ef }}

- name: Run a smoke test
- name: Run tests
if: steps.install-topiary.outcome == 'success'
run: |
## Run a tiny smoke test; checking that Topiary manages to start,
## parse a simple OCaml command and output the right thing.
echo 'open Foo' > expected.ml
echo 'open Foo' | opam exec -- topiary --language ocaml > result.ml
diff expected.ml result.ml
## NOTE: Proper tests are disabled because they actually do not pass for
## Topiary v0.1.0. These should be re-enabled in future versions.

# - name: Run tests
# if: steps.install-topiary.outcome == 'success'
# run: |
# ## Test on OCaml implementation files (.ml)
# cat topiary/tests/samples/input/ocaml.ml | opam exec -- topiary --language ocaml-implementation > ocaml.ml
# diff topiary/tests/samples/expected/ocaml.ml ocaml.ml
# ## Test on OCaml interface files (.mli)
# cat topiary/tests/samples/input/ocaml.mli | opam exec -- topiary --language ocaml-interface > ocaml.mli
# diff topiary/tests/samples/expected/ocaml.mli ocaml.mli
uses: ./.github/actions/run-tests
with:
topiary: opam exec -- topiary
samples: topiary/topiary/tests/samples

docker-based:
name: docker-based
Expand All @@ -146,6 +133,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true

- name: Build Docker image (see next step for failure)
id: build-docker-image
Expand All @@ -166,29 +155,9 @@ jobs:
step-outcome: ${{ steps.build-docker-image.outcome }}
expected-failure: ${{ matrix.ef }}

- name: Run a tiny smoke test
- name: Run tests
if: steps.build-docker-image.outcome == 'success'
run: |
echo 'open Foo' > expected.ml
echo 'open Foo' \
| docker run --interactive topiary --language ocaml \
> result.ml
diff expected.ml result.ml
## NOTE: Proper tests are disabled because they actually do not pass for
## Topiary v0.1.0. These should be re-enabled in future versions.

# - name: Run tests
# if: steps.build-docker-image.outcome == 'success'
# run: |
# set -euC
# ## Test on OCaml implementation files (.ml)
# cat topiary/tests/samples/input/ocaml.ml \
# | docker run --interactive topiary --language ocaml-implementation \
# > ocaml.ml
# diff topiary/tests/samples/expected/ocaml.ml ocaml.ml
# ## Test on OCaml interface files (.mli)
# cat topiary/tests/samples/input/ocaml.mli \
# | docker run --interactive topiary --language ocaml-interface \
# > ocaml.mli
# diff topiary/tests/samples/expected/ocaml.mli ocaml.mli
uses: ./.github/actions/run-tests
with:
topiary: docker run --interactive topiary
samples: topiary/topiary/tests/samples
Loading

0 comments on commit 04104df

Please sign in to comment.