From 89acc3afd8209d9586a39f4ef80660fe78c20f60 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Tue, 17 Mar 2020 15:51:58 +0100 Subject: [PATCH] Add GitHub Actions --- .github/workflows/rust-code-analysis.yml | 40 ++++++++++++++++++++++++ build.rs | 2 +- tree-sitter-mozcpp/src/scanner.cc | 2 +- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/rust-code-analysis.yml mode change 120000 => 100644 tree-sitter-mozcpp/src/scanner.cc diff --git a/.github/workflows/rust-code-analysis.yml b/.github/workflows/rust-code-analysis.yml new file mode 100644 index 000000000..c9b3fe5e4 --- /dev/null +++ b/.github/workflows/rust-code-analysis.yml @@ -0,0 +1,40 @@ +name: Run tests + +on: [push, pull_request] + +jobs: + test-code: + + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Checkout submodules + shell: bash + run: | + GIT_PATH=https://github.com/.extraheader + AUTH_HEADER="$(git config --local --get http.$GIT_PATH)" + git submodule sync --recursive + git -c "http.extraheader=$AUTH_HEADER" \ + -c protocol.version=2 \ + submodule update --init --force --recursive --depth=1 + + - name: Install Rust stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + + - name: Build + run: | + cargo build --all-features --verbose + + - name: Run tests + run: | + cargo test --all-features --verbose diff --git a/build.rs b/build.rs index a3a5d9e89..3ffe74a12 100644 --- a/build.rs +++ b/build.rs @@ -105,7 +105,7 @@ fn build_c(files: Vec, language: &str) { .opt_level(get_opt_level()) .debug(get_debug()) .warnings(false) - .flag("-std=c99"); + .flag_if_supported("-std=c99"); } build.compile(&format!("tree-sitter-{}-c", language)); } diff --git a/tree-sitter-mozcpp/src/scanner.cc b/tree-sitter-mozcpp/src/scanner.cc deleted file mode 120000 index 2dec44fd4..000000000 --- a/tree-sitter-mozcpp/src/scanner.cc +++ /dev/null @@ -1 +0,0 @@ -../../tree-sitter-cpp/src/scanner.cc \ No newline at end of file diff --git a/tree-sitter-mozcpp/src/scanner.cc b/tree-sitter-mozcpp/src/scanner.cc new file mode 100644 index 000000000..140d7249c --- /dev/null +++ b/tree-sitter-mozcpp/src/scanner.cc @@ -0,0 +1 @@ +#include "../../tree-sitter-cpp/src/scanner.cc"