2021-07-22 15:51:07 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
2021-09-15 04:23:39 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '.vscode/**'
|
2022-06-30 21:26:37 +00:00
|
|
|
- '**/*.md'
|
2021-07-22 15:51:07 +00:00
|
|
|
|
2021-11-29 21:11:15 +00: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 21:26:37 +00:00
|
|
|
env:
|
|
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
|
|
FORCE_COLOR: true
|
|
|
|
ASTRO_TELEMETRY_DISABLED: true
|
|
|
|
|
2021-07-22 15:51:07 +00:00
|
|
|
jobs:
|
2021-11-29 21:11:15 +00:00
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out repository
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-11-29 21:11:15 +00:00
|
|
|
|
2022-03-08 21:46:11 +00:00
|
|
|
- name: Setup PNPM
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
2022-03-08 21:46:11 +00:00
|
|
|
|
2021-11-29 21:11:15 +00:00
|
|
|
- name: Setup Node
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/setup-node@v3
|
2021-11-29 21:11:15 +00:00
|
|
|
with:
|
|
|
|
node-version: 16
|
2022-03-08 21:46:11 +00:00
|
|
|
cache: 'pnpm'
|
2021-11-29 21:11:15 +00:00
|
|
|
|
2022-03-09 16:12:12 +00:00
|
|
|
- name: Install dependencies
|
2022-03-08 21:46:11 +00:00
|
|
|
run: pnpm install
|
2022-03-09 16:12:12 +00:00
|
|
|
|
2021-11-29 21:11:15 +00:00
|
|
|
- name: Status
|
|
|
|
run: git status
|
|
|
|
|
2021-12-02 03:58:34 +00: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 21:46:11 +00:00
|
|
|
run: pnpm run lint
|
2022-03-09 16:12:12 +00:00
|
|
|
|
2021-12-02 03:58:34 +00:00
|
|
|
# Otherwise, run lint autofixer
|
2021-11-29 21:11:15 +00:00
|
|
|
- name: Lint
|
2021-12-02 03:58:34 +00:00
|
|
|
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }}
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: wearerequired/lint-action@v1.11.1
|
2021-11-29 21:11:15 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
eslint: true
|
2021-12-23 21:16:22 +00:00
|
|
|
prettier: false
|
2021-11-29 21:11:15 +00:00
|
|
|
auto_fix: true
|
2021-12-07 18:29:30 +00:00
|
|
|
git_name: github-actions[bot]
|
|
|
|
git_email: github-actions[bot]@users.noreply.github.com
|
2021-12-02 20:04:11 +00:00
|
|
|
commit_message: 'chore(lint): ${linter} fix'
|
2021-11-29 21:11:15 +00:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
neutral_check_on_warning: true
|
|
|
|
|
2022-03-01 19:59:06 +00: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 21:26:37 +00:00
|
|
|
run: pnpm run format --list
|
2022-03-01 19:59:06 +00:00
|
|
|
|
2022-06-30 21:26:37 +00:00
|
|
|
# Build primes out build caches for Turbo
|
2021-07-22 15:51:07 +00:00
|
|
|
build:
|
2022-06-30 21:26:37 +00:00
|
|
|
name: 'Build: ${{ matrix.os }}'
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
node_version: [14]
|
|
|
|
fail-fast: true
|
2021-11-29 21:11:15 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-11-29 21:11:15 +00:00
|
|
|
|
2022-03-08 21:46:11 +00:00
|
|
|
- name: Setup PNPM
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
2022-03-08 21:46:11 +00:00
|
|
|
|
2022-06-30 21:26:37 +00:00
|
|
|
- name: Setup node@${{ matrix.node_version }}
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/setup-node@v3
|
2021-11-29 21:11:15 +00:00
|
|
|
with:
|
2022-06-30 21:26:37 +00:00
|
|
|
node-version: ${{ matrix.node_version }}
|
2022-03-08 21:46:11 +00:00
|
|
|
cache: 'pnpm'
|
2021-12-10 00:11:49 +00:00
|
|
|
|
2022-03-09 16:12:12 +00:00
|
|
|
- name: Install dependencies
|
2022-03-08 21:46:11 +00:00
|
|
|
run: pnpm install
|
2022-06-30 21:26:37 +00:00
|
|
|
|
2021-11-29 21:11:15 +00:00
|
|
|
- name: Build Packages
|
2022-03-08 21:46:11 +00:00
|
|
|
run: pnpm run build
|
2021-11-29 21:11:15 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
name: 'Test: ${{ matrix.os }} (node@${{ matrix.node_version }})'
|
2021-07-22 15:51:07 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-06-30 21:26:37 +00:00
|
|
|
needs: build
|
2021-07-22 15:51:07 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
2021-12-16 23:53:22 +00:00
|
|
|
node_version: [14, 16]
|
2021-11-02 14:13:36 +00:00
|
|
|
include:
|
|
|
|
- os: windows-latest
|
2022-06-30 18:21:41 +00:00
|
|
|
node_version: 14
|
2021-11-11 17:24:48 +00:00
|
|
|
- os: macos-latest
|
2022-06-30 18:21:41 +00:00
|
|
|
node_version: 14
|
2021-07-22 15:51:07 +00:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
2021-11-29 21:11:15 +00:00
|
|
|
- name: Checkout
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-07-22 15:51:07 +00:00
|
|
|
|
2022-03-08 21:46:11 +00:00
|
|
|
- name: Setup PNPM
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
|
|
|
|
2021-11-29 21:11:15 +00:00
|
|
|
- name: Setup node@${{ matrix.node_version }}
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/setup-node@v3
|
2021-07-22 15:51:07 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node_version }}
|
2022-03-08 21:46:11 +00:00
|
|
|
cache: 'pnpm'
|
2021-07-22 15:51:07 +00:00
|
|
|
|
2022-03-30 12:42:19 +00:00
|
|
|
- name: Use Deno
|
|
|
|
uses: denoland/setup-deno@v1
|
|
|
|
with:
|
|
|
|
deno-version: v1.19.3
|
|
|
|
|
2022-03-09 16:12:12 +00:00
|
|
|
- name: Install dependencies
|
2022-03-08 21:46:11 +00:00
|
|
|
run: pnpm install
|
2021-07-22 15:51:07 +00:00
|
|
|
|
2022-06-30 21:26:37 +00:00
|
|
|
- name: Build Packages
|
|
|
|
run: pnpm run build
|
|
|
|
|
2021-07-22 15:51:07 +00:00
|
|
|
- name: Test
|
2022-03-08 21:46:11 +00:00
|
|
|
run: pnpm run test
|
2021-12-10 00:11:49 +00:00
|
|
|
|
2022-05-15 21:47:28 +00:00
|
|
|
e2e:
|
2022-06-30 18:21:41 +00:00
|
|
|
name: 'Test (E2E): ${{ matrix.os }} (node@${{ matrix.node_version }})'
|
2022-05-15 21:47:28 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-06-30 21:26:37 +00:00
|
|
|
timeout-minutes: 20
|
|
|
|
needs: build
|
2022-05-15 21:47:28 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-06-30 18:21:41 +00:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
node_version: [14]
|
2022-05-15 21:47:28 +00: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 21:26:37 +00:00
|
|
|
- name: Build Packages
|
|
|
|
run: pnpm run build
|
|
|
|
|
2022-05-15 21:47:28 +00:00
|
|
|
- name: Test
|
|
|
|
run: pnpm run test:e2e
|
|
|
|
|
2021-11-29 21:11:15 +00:00
|
|
|
smoke:
|
2022-06-30 18:21:41 +00:00
|
|
|
name: 'Test (Smoke): ${{ matrix.os }} (node@${{ matrix.node_version }})'
|
2021-12-13 22:31:18 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-06-30 21:26:37 +00:00
|
|
|
needs: build
|
2021-11-29 21:11:15 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-12 02:51:17 +00:00
|
|
|
os: [ubuntu-latest]
|
2022-06-30 18:21:41 +00:00
|
|
|
node_version: [14]
|
2021-07-22 15:51:07 +00:00
|
|
|
steps:
|
2022-07-12 02:51:17 +00:00
|
|
|
- name: Checkout docs
|
2022-03-02 22:08:42 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
2022-07-12 02:51:17 +00:00
|
|
|
repository: withastro/docs
|
2021-07-22 15:51:07 +00:00
|
|
|
|
2022-07-12 02:51:17 +00:00
|
|
|
- name: Checkout astro.build
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: withastro/astro.build
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-03-08 21:46:11 +00:00
|
|
|
|
|
|
|
- name: Setup PNPM
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
2022-03-08 21:46:11 +00:00
|
|
|
|
2022-06-30 18:21:41 +00:00
|
|
|
- name: Setup node@${{ matrix.node_version }}
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/setup-node@v3
|
2021-07-22 15:51:07 +00:00
|
|
|
with:
|
2022-06-30 18:21:41 +00:00
|
|
|
node-version: ${{ matrix.node_version }}
|
2022-03-08 21:46:11 +00:00
|
|
|
cache: 'pnpm'
|
2021-07-22 15:51:07 +00:00
|
|
|
|
2022-03-09 16:12:12 +00:00
|
|
|
- name: Install dependencies
|
2022-07-12 02:51:17 +00:00
|
|
|
run: pnpm install
|
2021-07-22 15:51:07 +00:00
|
|
|
|
2022-06-30 21:26:37 +00:00
|
|
|
- name: Build Packages
|
|
|
|
run: pnpm run build
|
|
|
|
|
2022-02-18 21:40:03 +00:00
|
|
|
- name: Test
|
2022-03-08 21:46:11 +00:00
|
|
|
run: pnpm run test:smoke
|
2021-12-13 22:31:18 +00:00
|
|
|
|
2021-11-29 21:11:15 +00:00
|
|
|
changelog:
|
|
|
|
name: Changelog PR or Release
|
2022-03-04 21:50:30 +00:00
|
|
|
if: ${{ (github.ref_name == 'main' || github.head_ref == 'next') && github.repository_owner == 'withastro' }}
|
2021-11-29 21:11:15 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-06-30 21:26:37 +00:00
|
|
|
needs: build
|
2021-11-29 21:11:15 +00:00
|
|
|
steps:
|
2022-03-09 16:12:12 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
2022-03-08 21:46:11 +00:00
|
|
|
- name: Setup PNPM
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: pnpm/action-setup@v2.2.1
|
2021-07-22 15:51:07 +00:00
|
|
|
|
2021-11-29 21:11:15 +00:00
|
|
|
- name: Setup Node
|
2022-03-09 16:12:12 +00:00
|
|
|
uses: actions/setup-node@v3
|
2021-11-29 21:11:15 +00:00
|
|
|
with:
|
|
|
|
node-version: 16
|
2022-03-08 21:46:11 +00:00
|
|
|
cache: 'pnpm'
|
2022-03-09 16:12:12 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-03-08 21:46:11 +00:00
|
|
|
run: pnpm install
|
2022-03-09 16:12:12 +00:00
|
|
|
|
2022-06-30 21:26:37 +00:00
|
|
|
- name: Build Packages
|
|
|
|
run: pnpm run build
|
|
|
|
|
2021-11-29 21:11:15 +00:00
|
|
|
- name: Create Release Pull Request or Publish
|
|
|
|
id: changesets
|
2021-11-29 21:23:08 +00:00
|
|
|
uses: changesets/action@v1
|
2021-11-29 21:11:15 +00:00
|
|
|
with:
|
2022-03-19 17:33:24 +00:00
|
|
|
# Note: pnpm install after versioning is necessary to refresh lockfile
|
2022-03-21 22:55:31 +00:00
|
|
|
version: pnpm run version
|
2022-03-08 21:46:11 +00:00
|
|
|
publish: pnpm exec changeset publish
|
2021-12-16 21:38:55 +00:00
|
|
|
commit: '[ci] release'
|
2021-11-29 21:11:15 +00:00
|
|
|
title: '[ci] release'
|
|
|
|
env:
|
2022-06-27 18:02:44 +00:00
|
|
|
# Needs access to push to main
|
|
|
|
GITHUB_TOKEN: ${{ secrets.FREDKBOT_GITHUB_TOKEN }}
|
|
|
|
# Needs access to publish to npm
|
2021-11-29 21:11:15 +00: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 }}
|