diff --git a/.github/workflows/luacheck.yaml b/.github/workflows/luacheck.yaml index 9be85c6..c59f622 100644 --- a/.github/workflows/luacheck.yaml +++ b/.github/workflows/luacheck.yaml @@ -11,13 +11,11 @@ on: jobs: luacheck: runs-on: self-hosted - container: - image: alpine:latest steps: - - uses: actions/checkout@v4 - - run: apk add --no-cache lua5.1 luarocks5.1 git - shell: /bin/sh - - run: luarocks-5.1 install luacheck - shell: /bin/sh - - run: luacheck . - shell: /bin/sh + - run: | + if ! command -v luacheck &> /dev/null; then + sudo apt-get update + sudo apt-get install -y lua-check + fi + - run: git clone --depth=1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git repo + - run: cd repo && luacheck . diff --git a/.github/workflows/stylua.yaml b/.github/workflows/stylua.yaml index afc449d..d155c31 100644 --- a/.github/workflows/stylua.yaml +++ b/.github/workflows/stylua.yaml @@ -11,16 +11,13 @@ on: jobs: stylua: runs-on: self-hosted - container: - image: alpine:latest steps: - - uses: actions/checkout@v4 - - run: apk add --no-cache curl unzip git - shell: /bin/sh - run: | - curl -L -o stylua.zip "https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux.zip" - unzip stylua.zip - chmod +x stylua - shell: /bin/sh - - run: ./stylua --check . - shell: /bin/sh + if ! command -v stylua &> /dev/null; then + curl -L -o /tmp/stylua.zip "https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux.zip" + unzip /tmp/stylua.zip -d /tmp + sudo mv /tmp/stylua /usr/local/bin/ + rm /tmp/stylua.zip + fi + - run: git clone --depth=1 $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git repo + - run: cd repo && stylua --check .