aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/tests.yml
blob: ca71ef2bc0493096928bf70a80d375588fb7f30a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Run tests

on: [push, pull_request]

jobs:
  luacheck:
    name: Luacheck
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3

      - name: Prepare
        run: |
          sudo apt-get update
          sudo add-apt-repository universe
          sudo apt install luarocks -y
          sudo luarocks install luacheck

      - name: Run Luacheck
        run: luacheck .

  typecheck:
    name: typecheck
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
      - uses: stevearc/nvim-typecheck-action@v1
        with:
          path: lua

  stylua:
    name: StyLua
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v3
      - name: Stylua
        uses: JohnnyMorganz/stylua-action@v3
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          version: v0.15.2
          args: --check .

  release:
    name: release

    if: ${{ github.ref == 'refs/heads/master' }}
    needs:
      - luacheck
      - stylua
      - typecheck
    runs-on: ubuntu-22.04
    steps:
      - uses: google-github-actions/release-please-action@v3
        id: release
        with:
          release-type: simple
          package-name: conform.nvim
      - uses: actions/checkout@v3
      - uses: rickstaa/action-create-tag@v1
        if: ${{ steps.release.outputs.release_created }}
        with:
          tag: stable
          message: "Current stable release: ${{ steps.release.outputs.tag_name }}"
          tag_exists_error: false
          force_push_tag: true