Summary: This is so we don't need the GITHUB_TOKEN that can not be added in forgejo. I am giving it a go and the `GITHUB_` prefix is reserved for secrets. There are also issues with the action in a forgejo environment due to the API not resolving to github. This now should work on both platforms. So we can maintain github compatibility for any pull requests that may come that way. Test Plan: Run the CI on github and forgejo, this will need to be a manual process to validate this works. Pull Request: #2
84 lines
2 KiB
YAML
84 lines
2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push: { branches: ["0.x"] }
|
|
pull_request: { branches: ["0.x"] }
|
|
|
|
jobs:
|
|
luacheck:
|
|
name: Luacheck
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install luarocks
|
|
run: sudo apt update && sudo apt install -y luarocks
|
|
|
|
- name: Install luacheck
|
|
run: sudo luarocks install luacheck
|
|
|
|
- name: Run luacheck
|
|
run: luacheck .
|
|
|
|
stylua:
|
|
name: StyLua
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Run stylua
|
|
run: npx @johnnymorganz/stylua-bin --check .
|
|
|
|
cargo-format:
|
|
name: Cargo Format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt
|
|
|
|
- name: Lint
|
|
run: cargo fmt --check
|
|
|
|
test:
|
|
name: Build and test
|
|
strategy:
|
|
matrix:
|
|
nvim-version: ["v0.9.5", "stable", "nightly"]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install dependencies
|
|
run: sudo apt update && sudo apt install -y build-essential luarocks
|
|
|
|
- name: Install busted
|
|
run: sudo luarocks install busted
|
|
|
|
- name: Install neovim
|
|
run: |
|
|
test -d _neovim || {
|
|
mkdir -p _neovim
|
|
curl -sL "https://github.com/neovim/neovim/releases/download/${{ matrix.nvim-version }}/nvim-linux64.tar.gz" | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
|
|
}
|
|
|
|
- name: Build
|
|
run: cargo build --release
|
|
|
|
- name: Run tests
|
|
run: |
|
|
export PATH="${PWD}/_neovim/bin:${PATH}"
|
|
export VIM="${PWD}/_neovim/share/nvim/runtime"
|
|
|
|
nvim --version
|
|
nvim -l ./scripts/busted.lua -o TAP ./lua/ivy/ 2> /dev/null
|