-
Notifications
You must be signed in to change notification settings - Fork 1.4k
84 lines (70 loc) · 2.43 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on:
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- v2
jobs:
tests:
runs-on: ubuntu-latest
if: github.event.action != 'closed'
steps:
# Check out, and set up the node/ruby infra
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16.x"
# Install, should be basically instant if cached
- run: yarn install
env:
YARN_CHECKSUM_BEHAVIOR: ignore
# Verify dependencies are hooked up right
- run: node test/verifyPackageVersions.js
# Grab localizations
- run: yarn docs-sync pull microsoft/TypeScript-Website-localizations#main 1
# Build the packages
- run: yarn bootstrap
- run: yarn build
# Verify it compiles
- run: yarn build-site
- run: cp -r packages/typescriptlang-org/public site
# Run all the package's tests
- run: yarn test
env:
CI: true
# Deploy preview environment for non-forks
- uses: Azure/static-web-apps-deploy@v1
if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_PROD }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: upload
app_location: site
skip_app_build: true
# Upload site artifact for forks so it can be deployed by a maintainer on-demand
- uses: actions/upload-artifact@v3
if: github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id
with:
name: site-${{ github.event.number }}
path: site/
# danger for PR builds
- if: github.event_name == 'pull_request' && github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
run: "yarn danger ci"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_DEPLOY_URL_ROOT: ${{ steps.deploy.outputs.static_web_app_url }}
windows:
if: github.event.action != 'closed'
runs-on: windows-latest
steps:
# Check out, and set up the node infra
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16.x"
# Get local dependencies
- run: yarn install
env:
YARN_CHECKSUM_BEHAVIOR: ignore
- run: yarn bootstrap
- run: yarn build