69
.github/workflows/ci.yaml
vendored
69
.github/workflows/ci.yaml
vendored
@@ -1,29 +1,60 @@
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
|
||||
name: NeoVim tests
|
||||
on: [push]
|
||||
name: ci
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
tags: ["*"]
|
||||
branches: ["*"]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
MISE_EXPERIMENTAL: true
|
||||
|
||||
jobs:
|
||||
code-quality:
|
||||
ci:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
XDG_CONFIG_HOME: ${{ github.workspace }}/.config/
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cachix/install-nix-action@v31
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
submodules: true
|
||||
|
||||
- name: Populate Nix store
|
||||
run:
|
||||
nix-shell --pure --run 'true'
|
||||
- name: Install apt dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libreadline-dev
|
||||
|
||||
- name: Type-check with lua-language-server
|
||||
run:
|
||||
nix-shell --pure --run 'make lint'
|
||||
- name: Setup environment
|
||||
run: |
|
||||
if [ -n "${{secrets.TOKEN}}" ]; then
|
||||
export GITHUB_TOKEN="${{secrets.TOKEN}}"
|
||||
fi
|
||||
export MISE_GITHUB_TOKEN="$GITHUB_TOKEN"
|
||||
echo "$GITHUB_TOKEN" >> $GITHUB_ENV
|
||||
echo "$MISE_GITHUB_TOKEN" >> $GITHUB_ENV
|
||||
|
||||
- name: Check formatting with stylua
|
||||
run:
|
||||
nix-shell --pure --run 'make fmt-check'
|
||||
- name: Install mise
|
||||
run: |
|
||||
curl https://mise.run | sh
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
echo "$HOME/.local/share/mise/bin" >> $GITHUB_PATH
|
||||
echo "$HOME/.local/share/mise/shims" >> $GITHUB_PATH
|
||||
|
||||
- name: Run busted tests
|
||||
run:
|
||||
nix-shell --pure --run 'make test'
|
||||
- name: Install mise dependencies
|
||||
run: |
|
||||
mise install
|
||||
mise list --local
|
||||
|
||||
- name: Check Lua formatting
|
||||
run: mise run fmt:check
|
||||
|
||||
- name: Check for type-errors
|
||||
run: mise run lint
|
||||
|
||||
- name: Run tests
|
||||
run: mise run test:all
|
||||
|
||||
Reference in New Issue
Block a user