diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..da5fcab33 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,53 @@ +name: Parser compilation and tests + +on: [push, pull_request] + +jobs: + check_compilation_unix_like: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + cc: [ gcc, clang ] + exclude: + - os: macos-latest + cc: gcc + + include: + - os: windows-latest + cc: cl + + - os: macos-latest + cc: gcc-10 + + name: Parser compilation + runs-on: ${{ matrix.os }} + env: + CC: ${{ matrix.cc }} + steps: + - uses: actions/checkout@v2 + - uses: ilammy/msvc-dev-cmd@v1.5.0 + + - name: Install and prepare Neovim + run: | + bash ./scripts/ci-install-${{ matrix.os }}.sh + + - name: Compile parsers Unix like + if: matrix.os != 'windows-latest' + run: | + nvim --headless -c "TSInstallSync all" -c "q" + + - name: Compile parsers Windows + if: matrix.os == 'windows-latest' + run: | + C:\\tools\\neovim\\Neovim\\bin\\nvim.exe --headless -c "TSInstallSync all" -c "q" + + - name: Post compile Windows + if: matrix.os == 'windows-latest' + run: cp -r ~/AppData/Local/nvim/pack/nvim-treesitter/start/nvim-treesitter/parser/* parser + shell: bash + + - uses: actions/upload-artifact@v2 + with: + name: parsers-${{ matrix.os }}-${{ matrix.cc }}-x86_64 + path: parser/* + diff --git a/scripts/ci-install-macos-latest.sh b/scripts/ci-install-macos-latest.sh new file mode 100644 index 000000000..a4f77b0b4 --- /dev/null +++ b/scripts/ci-install-macos-latest.sh @@ -0,0 +1,4 @@ +brew install neovim --HEAD +mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start +ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start + diff --git a/scripts/ci-install-ubuntu-latest.sh b/scripts/ci-install-ubuntu-latest.sh new file mode 100644 index 000000000..c245a122f --- /dev/null +++ b/scripts/ci-install-ubuntu-latest.sh @@ -0,0 +1,9 @@ +sudo apt-get update +sudo add-apt-repository universe +wget https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage +chmod u+x nvim.appimage +mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start +ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start +sudo cp ./nvim.appimage /usr/bin/nvim +sudo chmod uog+rwx /usr/bin/nvim + diff --git a/scripts/ci-install-windows-latest.sh b/scripts/ci-install-windows-latest.sh new file mode 100644 index 000000000..f69284e55 --- /dev/null +++ b/scripts/ci-install-windows-latest.sh @@ -0,0 +1,5 @@ +choco install neovim --pre +mkdir -p ~/AppData/Local/nvim/pack/nvim-treesitter/start +mkdir -p ~/AppData/Local/nvim-data +cp -r $(pwd) ~/AppData/Local/nvim/pack/nvim-treesitter/start +