chore(deps): update ci dependencies (non-major) (#332) #213
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint | |
on: | |
push: | |
branches: | |
- taiyme | |
- release | |
paths: | |
- .github/workflows/lint.yaml | |
- packages/**/* | |
pull_request_target: | |
branches: | |
- taiyme | |
- release | |
paths: | |
- packages/**/* | |
permissions: | |
contents: read | |
jobs: | |
pre-checkout: | |
name: Pre checkout | |
uses: ./.github/workflows/pre-checkout.yaml | |
run-pnpm-install: | |
name: Run pnpm install | |
runs-on: ubuntu-22.04 | |
needs: | |
- pre-checkout | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
ref: ${{ needs.pre-checkout.outputs.sha }} | |
fetch-depth: 1 | |
submodules: true | |
- name: Setup pnpm | |
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
with: | |
run_install: false | |
- name: Setup Node.js | |
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Install dependencies | |
run: | | |
pnpm i --frozen-lockfile | |
lint: | |
name: Lint | |
runs-on: ubuntu-22.04 | |
needs: | |
- pre-checkout | |
- run-pnpm-install | |
strategy: | |
fail-fast: false | |
matrix: | |
workspace: | |
- backend | |
- frontend | |
- frontend-embed | |
- frontend-shared | |
- misskey-bubble-game | |
- misskey-js | |
- misskey-reversi | |
- sw | |
env: | |
eslint-cache-version: v1 | |
eslint-cache-path: ${{ github.workspace }}/node_modules/.cache/eslint-${{ matrix.workspace }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
ref: ${{ needs.pre-checkout.outputs.sha }} | |
fetch-depth: 1 | |
submodules: true | |
- name: Setup pnpm | |
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
with: | |
run_install: false | |
- name: Setup Node.js | |
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Install dependencies | |
run: | | |
pnpm i --frozen-lockfile | |
- name: Restore eslint cache | |
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
path: ${{ env.eslint-cache-path }} | |
key: eslint-${{ env.eslint-cache-version }}-${{ matrix.workspace }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ needs.pre-checkout.outputs.sha }} | |
restore-keys: eslint-${{ env.eslint-cache-version }}-${{ matrix.workspace }}-${{ hashFiles('**/pnpm-lock.yaml') }}- | |
- name: Run eslint | |
run: | | |
pnpm --filter ${{ matrix.workspace }} run eslint --cache --cache-location ${{ env.eslint-cache-path }} --cache-strategy content | |
typecheck: | |
name: Typecheck | |
runs-on: ubuntu-22.04 | |
needs: | |
- pre-checkout | |
- run-pnpm-install | |
strategy: | |
fail-fast: false | |
matrix: | |
workspace: | |
- backend | |
- misskey-js | |
- sw | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
ref: ${{ needs.pre-checkout.outputs.sha }} | |
fetch-depth: 1 | |
submodules: true | |
- name: Setup pnpm | |
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
with: | |
run_install: false | |
- name: Setup Node.js | |
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: Install dependencies | |
run: | | |
pnpm i --frozen-lockfile | |
- name: Build (misskey-js) | |
if: matrix.workspace == 'backend' || matrix.workspace == 'sw' | |
run: | | |
pnpm --filter misskey-js run build | |
- name: Build (misskey-reversi) | |
if: matrix.workspace == 'backend' | |
run: | | |
pnpm --filter misskey-reversi run build | |
- name: Run typecheck | |
run: | | |
pnpm --filter ${{ matrix.workspace }} run typecheck | |
status-checks: | |
name: status-checks:lint # required status checks | |
runs-on: ubuntu-22.04 | |
if: always() | |
needs: | |
- lint | |
- typecheck | |
steps: | |
- name: Check needs results | |
env: | |
needs_result: ${{ toJSON(needs.*.result) }} | |
run: | | |
results="$(jq -r '.[]' <<< "$needs_result")" | |
echo "$results" | while read -r line; do | |
if [[ "$line" != "success" ]]; then | |
exit 1 | |
fi | |
done |