diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..2066d61 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,44 @@ +name: Check + +on: + push: + pull_request: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: pnpm/action-setup@v2.2.4 + with: + run_install: false + + - uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc + + - run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + shell: bash + id: pnpm-config + + - id: cache-rotation + shell: bash + run: echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + with: + path: ${{ steps.pnpm-config.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}- + + - run: pnpm install --frozen-lockfile --prefer-offline --silent + shell: bash + env: + HUSKY: 0 + + - run: pnpm type-check + + - run: pnpm lint + + - run: pnpm test