From c721b0925ceaa1c942152f74c53222d70f35d883 Mon Sep 17 00:00:00 2001 From: Tadayoshi Sato Date: Sun, 25 Sep 2022 15:25:17 +0900 Subject: [PATCH] chore(ci): add lint workflow --- .github/workflows/lint.yml | 38 ++++++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..26f1721d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: Lint + +on: + pull_request: + branches: + - main + paths: + - "src/**" + push: + branches: + - main + paths: + - "src/**" + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install + run: yarn install + - name: Lint + run: yarn lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a9d0e2f..8180641d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ on: - "**.md" jobs: - build: + test: runs-on: ubuntu-latest strategy: matrix: