forked from microsoft/TypeScript-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.77 KB
/
CI.yml
File metadata and controls
58 lines (49 loc) · 1.77 KB
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
name: CI
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
# Check out, and set up the node/ruby infra
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
# Get local dependencies
- run: yarn install
- run: yarn bootstrap
- run: yarn build
# PR: Deploy if we can
- name: Deploy PR Version
if: github.event_name == 'pull_request'
run: 'if test -z "$NOW_ACCESS_TOKEN"; then echo "Skipping deploy";
else npx now packages/typescriptlang-org/public/ --token="$NOW_ACCESS_TOKEN" --name="typescript-v2-$PR_NUMBER"; fi'
env:
NOW_ACCESS_TOKEN: ${{ secrets.NOW_ACCESS_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
# Run any tests
- run: yarn workspaces run test --ci
lighthouse_danger:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@master
- name: Run Lighthouse and test budgets
uses: treosh/lighthouse-ci-action@v1
with:
urls: |
https://typescript-v2-$PR_NUMBER.ortam.now.sh
https://typescript-v2-$PR_NUMBER.ortam.now.sh/tsconfig
https://typescript-v2-$PR_NUMBER.ortam.now.sh/docs/handbook/integrating-with-build-tools.html
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: lighthouse-results
path: './results'
# For danger stuff
- run: yarn install
# danger for PR builds
- if: github.event_name == 'pull_request'
run: 'if test -z "$GITHUB_TOKEN"; then echo "Skipping danger"; else yarn danger ci; fi'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}