From 7b3f26111555b1806104c3edd6f9ccfe4526673f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Cervera?= Date: Sun, 24 Nov 2024 12:16:58 -0600 Subject: [PATCH] ci: use asdf on gh actions Problem: The version in the GitHub Action might be different from the version used for development. Solution: Use asdf (https://asdf-vm.com) to standardize the stylua version used between ci and development. --- .github/workflows/ci.yml | 17 +++++++---------- .tool-versions | 2 ++ 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 .tool-versions diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bb7a37..02fbb21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,18 +18,15 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 - - name: Install stylua + - name: Install asdf shell: bash run: | - # To update the version of stylua refer to the releases page for the URL: - # https://github.com/JohnnyMorganz/StyLua/releases - curl -LO https://github.com/JohnnyMorganz/StyLua/releases/download/v2.0.1/stylua-linux-x86_64.zip - unzip stylua-linux-x86_64.zip - rm -rf /opt/stylua - mkdir -p /opt/stylua - mv stylua /opt/stylua - # Add the stylua binary to the system's path. - echo /opt/stylua >> ${GITHUB_PATH} + git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1 + . "$HOME/.asdf/asdf.sh" + + - name: Install stylua + shell: bash + run: asdf install stylua - name: Run stylua check run: make testfmt diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..36bd995 --- /dev/null +++ b/.tool-versions @@ -0,0 +1,2 @@ +lua-language-server 3.9.0 +stylua 2.0.1