mirror of
https://github.com/0x5eal/luau-unzip.git
synced 2025-04-11 09:40:53 +01:00
122 lines
3.2 KiB
YAML
122 lines
3.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
fmt:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install pesde
|
|
uses: lumin-org/setup-pesde@v0.4.0
|
|
with:
|
|
version: v0.6.0-rc.6+registry.0.2.0-rc.2
|
|
token: ${{ secrets.PESDE_TOKEN }}
|
|
cache: true
|
|
|
|
- name: Extract stylua version in manifest
|
|
uses: SebRollen/toml-action@v1.2.0
|
|
id: get_semver_range
|
|
with:
|
|
file: pesde.toml
|
|
field: dev_dependencies.stylua.version
|
|
|
|
- name: Install semver CLI
|
|
run: sudo apt-get install semver -y
|
|
|
|
- name: Parse stylua semver range into version
|
|
id: stylua
|
|
run: |
|
|
range="${{ steps.get_semver_range.value }}"
|
|
echo "version=$(gh api /repos/JohnnyMorganz/StyLua/tags --jq '.[] | .name' | xargs semver -r "$range" | tail -n 1)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install stylua
|
|
uses: JohnnyMorganz/stylua-action@v4
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
version: ${{ steps.stylua.version }}
|
|
args: --version
|
|
|
|
- name: Install dependencies
|
|
run: pesde install
|
|
|
|
- name: Check formatting
|
|
run: lune run fmt -- --check
|
|
|
|
typecheck:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install pesde
|
|
uses: lumin-org/setup-pesde@v0.4.0
|
|
with:
|
|
version: v0.6.0-rc.6+registry.0.2.0-rc.2
|
|
token: ${{ secrets.PESDE_TOKEN }}
|
|
cache: true
|
|
|
|
- name: Extract luau-lsp version in manifest
|
|
uses: SebRollen/toml-action@v1.2.0
|
|
id: get_semver_range
|
|
with:
|
|
file: pesde.toml
|
|
field: dev_dependencies.luau-lsp.version
|
|
|
|
- name: Install semver CLI
|
|
run: sudo apt-get install semver -y
|
|
|
|
- name: Parse luau-lsp semver range into version
|
|
id: luau-lsp
|
|
run: |
|
|
range="${{ steps.get_semver_range.value }}"
|
|
echo "version=$(gh api /repos/JohnnyMorganz/luau-lsp/tags --jq '.[] | .name' | xargs semver -r "$range" | tail -n 1)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install luau-lsp
|
|
shell: bash
|
|
run: |
|
|
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
cd /tmp
|
|
gh release download --repo JohnnyMorganz/luau-lsp "${{ steps.luau-lsp.version }}" --pattern luau-lsp-linux.zip
|
|
mkdir -p ~/.local/bin
|
|
unzip luau-lsp-linux.zip -d ~/.local/bin
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Install dependencies
|
|
run: pesde install
|
|
|
|
- name: Setup lune typedefs
|
|
run: lune setup
|
|
|
|
- name: Typecheck
|
|
run: lune run typecheck
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install pesde
|
|
uses: lumin-org/setup-pesde@v0.4.0
|
|
with:
|
|
version: v0.6.0-rc.6+registry.0.2.0-rc.2
|
|
token: ${{ secrets.PESDE_TOKEN }}
|
|
cache: true
|
|
|
|
- name: Install dependencies
|
|
run: pesde install
|
|
|
|
- name: Run tests
|
|
run: lune run test
|