Skip to content

Commit

Permalink
Publish parser source from Github Actions run
Browse files Browse the repository at this point in the history
The downside of not checking in `parser.c` is that you have to do a
bunch of setup to get one. This change just uploads the files that we
generated when GitHub Actions checked our code, making it accessible
to anyone who can read the repository.
  • Loading branch information
alex-pinkus committed Aug 28, 2021
1 parent f6d332a commit 2dbc19e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ jobs:
- run: npm install
- run: npm run ci
- run: npm test
- name: Publish parser source
uses: actions/upload-artifact@v2
with:
name: generated-parser-src
path: src
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ This repository currently omits most of the code that is autogenerated during a
`grammar.json` and `parser.c` are both only available following a build. It also significantly reduces noise during
diffs.

The side benefit of not checking in `parser.c` is that parsers aren't always backwards compatible. If you need a parser,
generate it yourself using the CLI; all the information to do so is available in this package. By doing that, you'll
also know for sure that your parser version and your library version are compatible.
The side benefit of not checking in `parser.c` is that you can guarantee backwards compatibility. Parsers generated by
the tree-sitter CLI aren't always backwards compatible. If you need a parser, generate it yourself using the CLI; all
the information to do so is available in this package. By doing that, you'll also know for sure that your parser version
and your library version are compatible.

If you need a `parser.c`, and you don't care about the tree-sitter version, but you don't have a local setup that would
allow you to obtain the parser, you can just download one from a recent workflow run in this package. To do so:
* Go to the [GitHub actions page](https://github.com/alex-pinkus/experimental-tree-sitter-swift/actions) for this
repository.
* Click on the appropriate commit.
* Go down to `Artifacts` and click on `generated-parser-src`. All the relevant parser files will be available in your
download.

0 comments on commit 2dbc19e

Please sign in to comment.