Skip to content

Commit

Permalink
ci: use asdf on gh actions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hernancerm committed Nov 24, 2024
1 parent b203380 commit 7b3f261
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lua-language-server 3.9.0
stylua 2.0.1

0 comments on commit 7b3f261

Please sign in to comment.