Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
314eter committed Mar 16, 2024
1 parent 000be50 commit 89dcace
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 204 deletions.
158 changes: 103 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,120 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- "**"
on: [push, pull_request]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
build-node:
name: build-node
runs-on: ubuntu-latest
test:
name: Test parser
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Display Node versions
run: |
node --version
npm --version
- name: Install dependencies
run: npm install

- name: Cache examples
uses: actions/cache@v4
- name: Set up the repo
uses: tree-sitter/[email protected]
- name: Set up examples
run: |-
git clone https://github.com/0install/0install examples/0install --single-branch --depth=1 --filter=blob:none
git clone https://github.com/BinaryAnalysisPlatform/bap examples/bap --single-branch --depth=1 --filter=blob:none
git clone https://github.com/dbuenzli/cmdliner examples/cmdliner --single-branch --depth=1 --filter=blob:none
git clone https://github.com/facebook/flow examples/flow --single-branch --depth=1 --filter=blob:none
git clone https://github.com/facebook/pyre-check examples/pyre-check --single-branch --depth=1 --filter=blob:none
git clone https://github.com/garrigue/lablgtk examples/lablgtk --single-branch --depth=1 --filter=blob:none
git clone https://github.com/janestreet/base examples/base --single-branch --depth=1 --filter=blob:none
git clone https://github.com/mirage/ocaml-cohttp examples/ocaml-cohttp --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocaml/dune examples/dune --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocaml/merlin examples/merlin --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocaml/ocaml examples/ocaml --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocaml/ocaml-lsp examples/ocaml-lsp --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocaml/opam examples/opam --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocaml-multicore/eio examples/eio --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocaml-ppx/ocamlformat examples/ocamlformat --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocaml-ppx/ppxlib examples/ppxlib --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocsigen/js_of_ocaml examples/js_of_ocaml --single-branch --depth=1 --filter=blob:none
git clone https://github.com/ocsigen/lwt examples/lwt --single-branch --depth=1 --filter=blob:none
git clone https://github.com/owlbarn/owl examples/owl --single-branch --depth=1 --filter=blob:none
- name: Run tests
uses: tree-sitter/[email protected]
with:
path: examples
key: ${{ hashFiles('script/parse-examples') }}

- name: Test corpus & parse examples
run: npm test
test-library: ${{runner.os == 'Linux'}}
corpus-files: |
examples/**/*.ml
examples/**/*.mli
invalid-files: |
examples/lablgtk/applications/osiris/osiris.ml
examples/lablgtk/examples/csview.ml
examples/lablgtk/tools/introspection/stubs/stubs_Atk.ml
examples/lablgtk/tools/introspection/stubs/stubs_Pango.ml
examples/lwt/src/unix/lwt_unix.cppo.ml
examples/lwt/src/unix/lwt_unix.cppo.mli
examples/merlin/tests/test-dirs/completion/infix.t/infix.ml
examples/merlin/tests/test-dirs/completion/parenthesize.t/parenthesize.ml
examples/merlin/tests/test-dirs/construct/c-modules.t/functor_app.ml
examples/merlin/tests/test-dirs/construct/c-modules.t/module.ml
examples/merlin/tests/test-dirs/errors/typing-after-parsing.t/test.ml
examples/merlin/tests/test-dirs/type-enclosing/issueLSP695.t/main.ml
examples/ocaml/stdlib/templates/float.template.mli
examples/ocaml/stdlib/templates/moreLabels.template.mli
examples/ocaml/testsuite/tests/generated-parse-errors/errors.ml
examples/ocaml/testsuite/tests/lexing/escape.ml
examples/ocaml/testsuite/tests/lexing/uchar_esc.ml
examples/ocaml/testsuite/tests/parse-errors/*
examples/ocaml/testsuite/tests/parsing/arrow_ambiguity.ml
examples/ocaml/testsuite/tests/parsing/constructor_declarations.ml
examples/ocaml/testsuite/tests/parsing/docstrings.ml
examples/ocaml/testsuite/tests/parsing/pr6604.ml
examples/ocaml/testsuite/tests/parsing/pr6604_2.ml
examples/ocaml/testsuite/tests/tool-toplevel/error_highlighting.ml
examples/ocaml/testsuite/tests/tool-toplevel/error_highlighting_use2.ml
examples/ocaml/testsuite/tests/tool-toplevel/error_highlighting_use3.ml
examples/ocaml/testsuite/tests/typing-misc/typecore_errors.ml
examples/ocaml/testsuite/tests/typing-sigsubst/sig_local_aliases_syntax_errors.ml
examples/ocaml/testsuite/tests/typing-warnings/pr7261.ml
examples/ocamlformat/test/failing/*/*
examples/ocamlformat/test/passing/*/*
examples/ocamlformat/test/rpc/big_margin/foo.ml
examples/ppxlib/astlib/astlib.ml
examples/ppxlib/astlib/location.ml
examples/ppxlib/astlib/longident.ml
examples/ppxlib/test/driver/non-compressible-suffix/test.ml
examples/ppxlib/test/expansion_helpers/mangle/test.ml
examples/ppxlib/test/ppx_import_support/test.ml
examples/ppxlib/test/quoter/test.ml
build-rust:
name: build-rust
runs-on: ubuntu-latest
test-swift:
name: Test Swift binding
runs-on: macos-14
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal

- name: Build
run: cargo build --release

run: swift build
- name: Test
run: cargo test
run: swift test

build-swift:
name: build-swift
runs-on: macos-14
test-go:
name: Test Go binding
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Build
run: swift build

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache-dependency-path: bindings/go/go.mod
- name: Get dependencies
working-directory: bindings/go
run: go get -t .
- name: Test
run: swift test
working-directory: bindings/go
run: go test
59 changes: 19 additions & 40 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,26 @@
name: publish
name: Publish package

on:
push:
tags:
- v*
tags: ["*"]

jobs:
crate:
if: github.repository_owner == 'tree-sitter'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Publish crate
uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
npm:
if: github.repository_owner == 'tree-sitter'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '12'
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm install

- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
uses: tree-sitter/workflows/.github/workflows/package-npm.yml@main
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
crates:
if: github.repository_owner == 'tree-sitter'
uses: tree-sitter/workflows/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}
# pypi:
# if: github.repository_owner == 'tree-sitter'
# uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@main
# secrets:
# PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}
48 changes: 0 additions & 48 deletions script/known_failures.txt

This file was deleted.

61 changes: 0 additions & 61 deletions script/parse-examples

This file was deleted.

0 comments on commit 89dcace

Please sign in to comment.