2021-07-22 10:51:07 -05:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
2021-09-14 23:23:39 -05:00
|
|
|
paths-ignore:
|
|
|
|
- '.vscode/**'
|
2022-06-30 16:26:37 -05:00
|
|
|
- '**/*.md'
|
2021-07-22 10:51:07 -05:00
|
|
|
|
2021-11-29 16:11:15 -05:00
|
|
|
# Automatically cancel in-progress actions on the same branch
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2022-06-30 16:26:37 -05:00
|
|
|
env:
|
|
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
|
|
FORCE_COLOR: true
|
|
|
|
ASTRO_TELEMETRY_DISABLED: true
|
|
|
|
|
2021-07-22 10:51:07 -05:00
|
|
|
jobs:
|
2021-11-29 16:11:15 -05:00
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out repository
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: actions/checkout@v3
|
2021-11-29 16:11:15 -05:00
|
|
|
|
2022-03-08 16:46:11 -05:00
|
|
|
- name: Setup PNPM
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
2022-03-08 16:46:11 -05:00
|
|
|
|
2021-11-29 16:11:15 -05:00
|
|
|
- name: Setup Node
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: actions/setup-node@v3
|
2021-11-29 16:11:15 -05:00
|
|
|
with:
|
|
|
|
node-version: 16
|
2022-03-08 16:46:11 -05:00
|
|
|
cache: 'pnpm'
|
2021-11-29 16:11:15 -05:00
|
|
|
|
2022-03-09 11:12:12 -05:00
|
|
|
- name: Install dependencies
|
2022-03-08 16:46:11 -05:00
|
|
|
run: pnpm install
|
2022-03-09 11:12:12 -05:00
|
|
|
|
2021-11-29 16:11:15 -05:00
|
|
|
- name: Status
|
|
|
|
run: git status
|
|
|
|
|
2021-12-01 22:58:34 -05:00
|
|
|
# Lint autofix cannot run on forks, so just skip those! See https://github.com/wearerequired/lint-action/issues/13
|
|
|
|
- name: Lint (External)
|
|
|
|
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
|
2022-03-08 16:46:11 -05:00
|
|
|
run: pnpm run lint
|
2022-03-09 11:12:12 -05:00
|
|
|
|
2021-12-01 22:58:34 -05:00
|
|
|
# Otherwise, run lint autofixer
|
2021-11-29 16:11:15 -05:00
|
|
|
- name: Lint
|
2021-12-01 22:58:34 -05:00
|
|
|
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }}
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: wearerequired/lint-action@v1.11.1
|
2021-11-29 16:11:15 -05:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
eslint: true
|
2021-12-23 16:16:22 -05:00
|
|
|
prettier: false
|
2021-11-29 16:11:15 -05:00
|
|
|
auto_fix: true
|
2021-12-07 13:29:30 -05:00
|
|
|
git_name: github-actions[bot]
|
|
|
|
git_email: github-actions[bot]@users.noreply.github.com
|
2021-12-02 15:04:11 -05:00
|
|
|
commit_message: 'chore(lint): ${linter} fix'
|
2021-11-29 16:11:15 -05:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
neutral_check_on_warning: true
|
|
|
|
|
2022-03-01 14:59:06 -05:00
|
|
|
# Checks that the formatter runs successfully on all files
|
|
|
|
# In the future, we may have this fail PRs on unformatted code
|
|
|
|
- name: Format Check
|
2022-06-30 16:26:37 -05:00
|
|
|
run: pnpm run format --list
|
2022-03-01 14:59:06 -05:00
|
|
|
|
2022-06-30 16:26:37 -05:00
|
|
|
# Build primes out build caches for Turbo
|
2021-07-22 10:51:07 -05:00
|
|
|
build:
|
2022-06-30 16:26:37 -05:00
|
|
|
name: 'Build: ${{ matrix.os }}'
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
node_version: [14]
|
|
|
|
fail-fast: true
|
2021-11-29 16:11:15 -05:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: actions/checkout@v3
|
2021-11-29 16:11:15 -05:00
|
|
|
|
2022-03-08 16:46:11 -05:00
|
|
|
- name: Setup PNPM
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
2022-03-08 16:46:11 -05:00
|
|
|
|
2022-06-30 16:26:37 -05:00
|
|
|
- name: Setup node@${{ matrix.node_version }}
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: actions/setup-node@v3
|
2021-11-29 16:11:15 -05:00
|
|
|
with:
|
2022-06-30 16:26:37 -05:00
|
|
|
node-version: ${{ matrix.node_version }}
|
2022-03-08 16:46:11 -05:00
|
|
|
cache: 'pnpm'
|
2021-12-09 19:11:49 -05:00
|
|
|
|
2022-03-09 11:12:12 -05:00
|
|
|
- name: Install dependencies
|
2022-03-08 16:46:11 -05:00
|
|
|
run: pnpm install
|
2022-06-30 16:26:37 -05:00
|
|
|
|
2021-11-29 16:11:15 -05:00
|
|
|
- name: Build Packages
|
2022-03-08 16:46:11 -05:00
|
|
|
run: pnpm run build
|
2021-11-29 16:11:15 -05:00
|
|
|
|
|
|
|
test:
|
|
|
|
name: 'Test: ${{ matrix.os }} (node@${{ matrix.node_version }})'
|
2021-07-22 10:51:07 -05:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-06-30 16:26:37 -05:00
|
|
|
needs: build
|
2021-07-22 10:51:07 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
2021-12-16 18:53:22 -05:00
|
|
|
node_version: [14, 16]
|
2021-11-02 09:13:36 -05:00
|
|
|
include:
|
|
|
|
- os: windows-latest
|
2022-06-30 13:21:41 -05:00
|
|
|
node_version: 14
|
2021-11-11 12:24:48 -05:00
|
|
|
- os: macos-latest
|
2022-06-30 13:21:41 -05:00
|
|
|
node_version: 14
|
2021-07-22 10:51:07 -05:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
2021-11-29 16:11:15 -05:00
|
|
|
- name: Checkout
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: actions/checkout@v3
|
2021-07-22 10:51:07 -05:00
|
|
|
|
2022-03-08 16:46:11 -05:00
|
|
|
- name: Setup PNPM
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
|
|
|
|
2021-11-29 16:11:15 -05:00
|
|
|
- name: Setup node@${{ matrix.node_version }}
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: actions/setup-node@v3
|
2021-07-22 10:51:07 -05:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node_version }}
|
2022-03-08 16:46:11 -05:00
|
|
|
cache: 'pnpm'
|
2021-07-22 10:51:07 -05:00
|
|
|
|
2022-03-30 07:42:19 -05:00
|
|
|
- name: Use Deno
|
|
|
|
uses: denoland/setup-deno@v1
|
|
|
|
with:
|
|
|
|
deno-version: v1.19.3
|
|
|
|
|
2022-03-09 11:12:12 -05:00
|
|
|
- name: Install dependencies
|
2022-03-08 16:46:11 -05:00
|
|
|
run: pnpm install
|
2021-07-22 10:51:07 -05:00
|
|
|
|
2022-06-30 16:26:37 -05:00
|
|
|
- name: Build Packages
|
|
|
|
run: pnpm run build
|
|
|
|
|
2021-07-22 10:51:07 -05:00
|
|
|
- name: Test
|
2022-03-08 16:46:11 -05:00
|
|
|
run: pnpm run test
|
2021-12-09 19:11:49 -05:00
|
|
|
|
2022-05-15 16:47:28 -05:00
|
|
|
e2e:
|
2022-06-30 13:21:41 -05:00
|
|
|
name: 'Test (E2E): ${{ matrix.os }} (node@${{ matrix.node_version }})'
|
2022-05-15 16:47:28 -05:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-06-30 16:26:37 -05:00
|
|
|
timeout-minutes: 20
|
|
|
|
needs: build
|
2022-05-15 16:47:28 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-06-30 13:21:41 -05:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
node_version: [14]
|
2022-05-15 16:47:28 -05:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup PNPM
|
|
|
|
uses: pnpm/action-setup@v2.2.1
|
|
|
|
|
|
|
|
- name: Setup node@${{ matrix.node_version }}
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
cache: 'pnpm'
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
2022-06-30 16:26:37 -05:00
|
|
|
- name: Build Packages
|
|
|
|
run: pnpm run build
|
|
|
|
|
2022-05-15 16:47:28 -05:00
|
|
|
- name: Test
|
|
|
|
run: pnpm run test:e2e
|
|
|
|
|
2021-11-29 16:11:15 -05:00
|
|
|
smoke:
|
2022-06-30 13:21:41 -05:00
|
|
|
name: 'Test (Smoke): ${{ matrix.os }} (node@${{ matrix.node_version }})'
|
2021-12-13 17:31:18 -05:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-06-30 16:26:37 -05:00
|
|
|
needs: build
|
2021-11-29 16:11:15 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-06-30 13:21:41 -05:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
node_version: [14]
|
2021-07-22 10:51:07 -05:00
|
|
|
steps:
|
2021-11-29 16:11:15 -05:00
|
|
|
- name: Checkout
|
2022-03-02 17:08:42 -05:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
2021-07-22 10:51:07 -05:00
|
|
|
|
2022-03-08 16:46:11 -05:00
|
|
|
- name: Update submodules
|
|
|
|
run: git submodule update --remote
|
|
|
|
|
|
|
|
- name: Setup PNPM
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
2022-03-08 16:46:11 -05:00
|
|
|
|
2022-06-30 13:21:41 -05:00
|
|
|
- name: Setup node@${{ matrix.node_version }}
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: actions/setup-node@v3
|
2021-07-22 10:51:07 -05:00
|
|
|
with:
|
2022-06-30 13:21:41 -05:00
|
|
|
node-version: ${{ matrix.node_version }}
|
2022-03-08 16:46:11 -05:00
|
|
|
cache: 'pnpm'
|
2021-07-22 10:51:07 -05:00
|
|
|
|
2022-03-09 11:12:12 -05:00
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install --no-frozen-lockfile
|
2021-07-22 10:51:07 -05:00
|
|
|
|
2022-06-30 16:26:37 -05:00
|
|
|
- name: Build Packages
|
|
|
|
run: pnpm run build
|
|
|
|
|
2022-02-18 16:40:03 -05:00
|
|
|
- name: Test
|
2022-03-08 16:46:11 -05:00
|
|
|
run: pnpm run test:smoke
|
2021-12-13 17:31:18 -05:00
|
|
|
|
2021-11-29 16:11:15 -05:00
|
|
|
changelog:
|
|
|
|
name: Changelog PR or Release
|
2022-03-04 16:50:30 -05:00
|
|
|
if: ${{ (github.ref_name == 'main' || github.head_ref == 'next') && github.repository_owner == 'withastro' }}
|
2021-11-29 16:11:15 -05:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-30 16:26:37 -05:00
|
|
|
needs: build
|
2021-11-29 16:11:15 -05:00
|
|
|
steps:
|
2022-03-09 11:12:12 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-03-08 16:46:11 -05:00
|
|
|
- name: Setup PNPM
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
2021-07-22 10:51:07 -05:00
|
|
|
|
2021-11-29 16:11:15 -05:00
|
|
|
- name: Setup Node
|
2022-03-09 11:12:12 -05:00
|
|
|
uses: actions/setup-node@v3
|
2021-11-29 16:11:15 -05:00
|
|
|
with:
|
|
|
|
node-version: 16
|
2022-03-08 16:46:11 -05:00
|
|
|
cache: 'pnpm'
|
2022-03-09 11:12:12 -05:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-03-08 16:46:11 -05:00
|
|
|
run: pnpm install
|
2022-03-09 11:12:12 -05:00
|
|
|
|
2022-06-30 16:26:37 -05:00
|
|
|
- name: Build Packages
|
|
|
|
run: pnpm run build
|
|
|
|
|
2021-11-29 16:11:15 -05:00
|
|
|
- name: Create Release Pull Request or Publish
|
|
|
|
id: changesets
|
2021-11-29 16:23:08 -05:00
|
|
|
uses: changesets/action@v1
|
2021-11-29 16:11:15 -05:00
|
|
|
with:
|
2022-03-19 12:33:24 -05:00
|
|
|
# Note: pnpm install after versioning is necessary to refresh lockfile
|
2022-03-21 17:55:31 -05:00
|
|
|
version: pnpm run version
|
2022-03-08 16:46:11 -05:00
|
|
|
publish: pnpm exec changeset publish
|
2021-12-16 16:38:55 -05:00
|
|
|
commit: '[ci] release'
|
2021-11-29 16:11:15 -05:00
|
|
|
title: '[ci] release'
|
|
|
|
env:
|
2022-06-27 13:02:44 -05:00
|
|
|
# Needs access to push to main
|
|
|
|
GITHUB_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
|
|
|
|
# Needs access to publish to npm
|
2021-11-29 16:11:15 -05:00
|
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
|
|
|
|
- name: Generate Notification
|
|
|
|
id: notification
|
|
|
|
if: steps.changesets.outputs.published == 'true'
|
|
|
|
run: message=$(node scripts/notify/index.js '${{ steps.changesets.outputs.publishedPackages }}') && echo ::set-output name=message::${message//$'\n'/'%0A'}
|
|
|
|
|
|
|
|
- name: Discord Notification
|
|
|
|
if: steps.changesets.outputs.published == 'true'
|
|
|
|
id: discord-notification
|
|
|
|
env:
|
|
|
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
|
|
uses: Ilshidur/action-discord@0.3.2
|
|
|
|
with:
|
|
|
|
args: ${{ steps.notification.outputs.message }}
|