Skip to content

Commit daaa736

Browse files
committed
Add GitHub Actions
1 parent 368d3c8 commit daaa736

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test-code:
7+
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, macos-latest, windows-latest]
11+
12+
runs-on: ${{ matrix.os }}
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Checkout submodules
18+
shell: bash
19+
run: |
20+
GIT_PATH=https://github.com/.extraheader
21+
AUTH_HEADER="$(git config --local --get http.$GIT_PATH)"
22+
git submodule sync --recursive
23+
git -c "http.extraheader=$AUTH_HEADER" \
24+
-c protocol.version=2 \
25+
submodule update --init --force --recursive --depth=1
26+
27+
- name: Install Rust stable
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
profile: minimal
31+
toolchain: stable
32+
override: true
33+
34+
- name: Build
35+
shell: bash
36+
run: |
37+
cargo build --all-features --verbose
38+
39+
- name: Run tests
40+
shell: bash
41+
run: |
42+
cargo test --all-features --verbose

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn build_c(files: Vec<String>, language: &str) {
105105
.opt_level(get_opt_level())
106106
.debug(get_debug())
107107
.warnings(false)
108-
.flag("-std=c99");
108+
.flag_if_supported("-std=c99");
109109
}
110110
build.compile(&format!("tree-sitter-{}-c", language));
111111
}

0 commit comments

Comments
 (0)