Skip to content

Commit

Permalink
ci: use aqua in GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
koyashiro committed Jan 29, 2024
1 parent 53e2030 commit e04230a
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 40 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,28 @@ on:
push:
branches:
- main
paths:
- ".github/workflows/**"
pull_request:
paths:
- ".github/workflows/**"

jobs:
actionlint:
name: Lint workflows
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/[email protected]

- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Cache aqua dir
uses: actions/[email protected]
with:
path: ~/.local/share/aquaproj-aqua
key: aqua-installer-${{ hashFiles('aqua.yaml') }}
restore-keys: |
aqua-installer-
- name: Check workflow files
run: ${{ steps.get_actionlint.outputs.executable }} -color
shell: bash
- name: Setup aqua
uses: aquaproj/[email protected]
with:
aqua_version: v2.21.3
aqua_opts: ""

- name: Run actionlint
run: actionlint -color
5 changes: 2 additions & 3 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ on:
jobs:
luacheck:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1

- name: Run luacheck
uses: nebularg/actions-luacheck@v1
uses: nebularg/actions-luacheck@v1.1.2
29 changes: 19 additions & 10 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,24 @@ on:

jobs:
shellcheck:
name: Run shellcheck
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/[email protected]

- name: shellcheck
run: |
docker run \
--rm \
--volume "$PWD":/root/.dotfiles:ro \
--entrypoint /root/.dotfiles/lint/shellcheck.sh \
koalaman/shellcheck-alpine:latest
- name: Cache aqua dir
uses: actions/[email protected]
with:
path: ~/.local/share/aquaproj-aqua
key: aqua-installer-${{ hashFiles('aqua.yaml') }}
restore-keys: |
aqua-installer-
- name: Setup aqua
uses: aquaproj/[email protected]
with:
aqua_version: v2.21.3
aqua_opts: ""

- name: Run shellcheck
run: ./lint/shellcheck.sh
20 changes: 15 additions & 5 deletions .github/workflows/shfmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,24 @@ on:

jobs:
shfmt:
name: Run shfmt
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1

- name: Setup shfmt
uses: mfinelli/setup-shfmt@v3
- name: Cache aqua dir
uses: actions/[email protected]
with:
path: ~/.local/share/aquaproj-aqua
key: aqua-installer-${{ hashFiles('aqua.yaml') }}
restore-keys: |
aqua-installer-
- name: Setup aqua
uses: aquaproj/[email protected]
with:
aqua_version: v2.21.3
aqua_opts: ""

- name: Run shfmt
run: |
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/stylua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,24 @@ on:

jobs:
luacheck:
runs-on: ubuntu-latest

runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.1.1

- name: Run StyLua
uses: JohnnyMorganz/stylua-action@v3
- name: Cache aqua dir
uses: actions/[email protected]
with:
path: ~/.local/share/aquaproj-aqua
key: aqua-installer-${{ hashFiles('aqua.yaml') }}
restore-keys: |
aqua-installer-
- name: Setup aqua
uses: aquaproj/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest
args: --check .
aqua_version: v2.21.3
aqua_opts: ""

- name: Run StyLua
run: styelua --check .
1 change: 1 addition & 0 deletions aqua.yaml

0 comments on commit e04230a

Please sign in to comment.