Skip to content

Commit

Permalink
github-actions: add initial linter workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
CogentRedTester committed Jan 27, 2025
1 parent fbc5afa commit af1dd20
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# This is a basic workflow to help you get started with Actions

name: Lint

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
path: ./file-browser

- name: Get LuaLS version
id: get-luaLS-version
run: |
version=$(curl https://api.github.com/repos/LuaLS/lua-language-server/releases/latest | jq -r '.tag_name')
echo $version
echo "version=$version" >> $GITHUB_OUTPUT
shell: bash

- name: Cache Lua Language Server
uses: actions/cache@v4
id: cache
with:
key: ${{ steps.get-luaLS-version.outputs.version }}
path: ./luals

- uses: actions/checkout@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
repository: LuaLS/lua-language-server
ref: ${{ steps.get-luaLS-version.outputs.version }}
path: ./luals

# Runs a single command using the runners shell
- name: Install Lua Language Server
if: steps.cache.outputs.cache-hit != 'true'
working-directory: ./luals
run: |
echo Running Lua Language Server build script
sudo apt-get update
sudo apt-get -y install ninja-build
./make.sh
# Runs a set of commands using the runners shell
- name: Run LuaLS
run: |
./luals/bin/lua-language-server --check ./file-browser --logpath ./log
cat ./log/check.json
- uses: actions/upload-artifact@v4
with:
name: lua-language-server type check
path: ./log/check.json

- name: Test output
shell: bash
run: |
FILE="./log/check.json"
if [ "$(jq 'length' "$FILE")" -gt 0 ]; then
jq '.' "$FILE" >&2
exit 1
fi

0 comments on commit af1dd20

Please sign in to comment.