Skip to content

Upgrade to TypeScript 5 (#738) #1265

Upgrade to TypeScript 5 (#738)

Upgrade to TypeScript 5 (#738) #1265

Workflow file for this run

name: Website
on:
pull_request:
branches: [main]
paths:
- 'packages/website/**'
- '.github/**'
- 'package.json'
- 'yarn.lock'
push:
branches: [main]
paths:
- 'packages/website/**'
- '.github/**'
- 'package.json'
- 'yarn.lock'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- name: restore lerna
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: |
yarn
yarn lerna bootstrap
- name: Build
run: yarn lerna run build --scope website
- name: Lint
run: yarn lerna run lint --scope website
- name: Test
run: yarn lerna run test --scope website
os-compatibility:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
# - macos-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- name: restore lerna
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- run: |
yarn
yarn lerna bootstrap
- name: Build
run: yarn lerna run build --scope website
- name: Test
run: yarn lerna run test --scope website
node-compatibility:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: ${{ matrix.node-version }}
- name: restore lerna
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- run: |
yarn
yarn lerna bootstrap
- name: Build
run: yarn lerna run build --scope website
- name: Test
run: yarn lerna run test --scope website
ts-compatibility:
needs: build
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
typescript-version: ['~5.0.0', '~5.1.0', latest, next, beta, rc]
include:
- typescript-version: '~5.0.0'
experimental: false
name: 'ts-5.0'
- typescript-version: '~5.1.0'
experimental: false
name: 'ts-5.1'
- typescript-version: latest
experimental: false
name: 'ts-stable'
- typescript-version: beta
experimental: false
name: 'ts-beta'
- typescript-version: rc
experimental: true
name: 'ts-rc'
- typescript-version: next
experimental: true
name: 'ts-canary'
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
- name: restore lerna
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ matrix.typescript-version }}-${{ hashFiles('**/yarn.lock') }}
- run: |
yarn
yarn lerna bootstrap
- name: Installing TypeScript ${{ matrix.typescript-version }}
run: |
yarn lerna add -D typescript@${{ matrix.typescript-version}}
- name: Build
run: yarn lerna run build --scope website
- name: TypeScript compile
run: |
yarn replace-in-file 'import chalk' 'import * as chalk' node_modules/gatsby-cli/lib/reporter/reporter.d.ts
yarn lerna run typecheck --scope website
- name: Test
run: yarn lerna run test --scope website
publish:
needs: [build, os-compatibility, node-compatibility, ts-compatibility]
runs-on: ubuntu-latest
if: success() && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v1
- uses: volta-cli/action@v1
- run: |
yarn
yarn lerna bootstrap
- name: Build
run: yarn lerna run build-prod --scope website
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
publish_dir: ./packages/website/public
cname: www.typescript-training.com