forked from shadowwalker/next-pwa
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): added new workflows (#31)
- Loading branch information
Showing
9 changed files
with
189 additions
and
44 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Build and test | ||
on: [workflow_call] | ||
env: | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | ||
TURBO_REMOTE_ONLY: true | ||
jobs: | ||
# TODO: add tests | ||
build_and_test: | ||
name: 🔎 Typecheck, check formatting and lint | ||
uses: ./.github/workflows/build-reusable.yml | ||
with: | ||
afterBuild: | | ||
pnpm typecheck && | ||
pnpm format:check && | ||
pnpm lint && | ||
pnpm docs:lint | ||
secrets: inherit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build reusable | ||
on: | ||
workflow_call: | ||
inputs: | ||
skipInstallBuild: | ||
required: false | ||
description: "whether to skip pnpm install && pnpm build" | ||
type: string | ||
nodeVersion: | ||
required: false | ||
description: "version of Node.js to use" | ||
type: string | ||
pnpmVersion: | ||
required: false | ||
description: "version of pnpm to use" | ||
type: string | ||
afterBuild: | ||
required: false | ||
description: "additional steps to run" | ||
type: string | ||
env: | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | ||
TURBO_REMOTE_ONLY: true | ||
jobs: | ||
build: | ||
name: ⬣, 🔎, 🔨 Typecheck, lint, and build on Node ${{ matrix.node-version }} and ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
node-version: ${{ fromJson(inputs.nodeVersion || '["18.x"]') }} | ||
pnpm-version: ${{ fromJson(inputs.pnpmVersion || '["8.x"]') }} | ||
os: [ubuntu-latest] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Use pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ matrix.pnpm-version }} | ||
- name: Use Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
- name: Install dependencies | ||
run: pnpm install | ||
if: ${{ inputs.skipInstallBuild != 'yes' }} | ||
- name: Build | ||
run: pnpm build | ||
if: ${{ inputs.skipInstallBuild != 'yes' }} | ||
- name: Run after build | ||
run: /bin/bash -c "${{ inputs.afterBuild }}" |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Check a pull request | ||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
env: | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }} | ||
TURBO_REMOTE_ONLY: true | ||
jobs: | ||
ensure_changelog_exists: | ||
name: 🔎 Ensure that .changeset is not empty | ||
runs-on: [ubuntu-latest] | ||
strategy: | ||
matrix: | ||
node-version: ["18.x"] | ||
pnpm-version: ["8.x"] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: 0 | ||
- name: Use Node ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install changeset CLI | ||
run: npm i -g @changesets/cli@$(node -p "require('./package.json').devDependencies['@changesets/cli']") | ||
- name: Ensure that a changelog is added | ||
run: npx changeset status --since=origin/master | ||
test: | ||
name: ⬣, 🔎, 🔨 Test PR | ||
uses: ./.github/workflows/build-and-test.yml | ||
secrets: inherit |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.