From 037740aed01928caa1473e922ea115d4cf8a3f19 Mon Sep 17 00:00:00 2001 From: moyiz <8603313+moyiz@users.noreply.github.com> Date: Thu, 9 May 2024 10:38:09 +0300 Subject: [PATCH] ci: add a github action to lint and test PRs --- .github/workflows/pr.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/pr.yaml diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 0000000..00ea876 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,31 @@ +name: Lint and Test +on: + - pull_request +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - if: env.ACT == 'true' + run: | + apt-get update && apt-get install -y unzip && apt-get clean + - uses: JohnnyMorganz/stylua-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: "latest" + args: --check . + test: + runs-on: ubuntu-latest + steps: + - name: Install Neovim + uses: rhysd/action-setup-vim@v1 + with: + neovim: true + - uses: actions/checkout@v4 + - if: env.ACT == 'true' + run: | + apt-get update + apt-get install -y make git + apt-get clean + - run: | + make test