@@ -3,160 +3,91 @@ name: build
3
3
on :
4
4
# Run on PRs and pushes to the default branch.
5
5
push :
6
- branches : [ master ]
6
+ branches :
7
+ - main
7
8
pull_request :
8
- branches : [ master ]
9
+ branches :
10
+ - main
9
11
schedule :
10
12
- cron : " 0 0 * * 0"
11
13
12
14
env :
13
- _OS_NAME : linux
14
- DART_SITE_ENV_DEFS : 1
15
- JEKYLL_ENV : production
15
+ # Keep for Dart SDK reporting
16
16
PUB_ENVIRONMENT : bot.github
17
- SITE_LOCALHOST_PORT : 5000
18
- SITE_JEKYLL_DEST : _site
19
- SITE_JEKYLL_SRC : src
20
- TMP : ${{ github.workspace }}/tmp
21
- TZ : US/Pacific # normalize build timestamp
17
+ # LTS
18
+ NODE_VERSION : ' 16 '
19
+ # Tool location
20
+ BASE_DIR : ${{ github.workspace }}
21
+ TOOL_DIR : ${{ github.workspace }}/tool
22
22
23
23
jobs :
24
+
24
25
test :
25
26
runs-on : ubuntu-latest
26
27
strategy :
27
28
fail-fast : false
28
29
matrix :
29
- sdk : [dev, beta, stable]
30
- task :
31
- - ./tool/build.sh --check-links
32
- - ./tool/check-code.sh
33
- experimental : [false]
34
- include :
35
- - sdk : dev
36
- task : ./tool/analyze-and-test-examples.sh
37
- experimental : false
38
- - sdk : beta
39
- task : ./tool/analyze-and-test-examples.sh
40
- experimental : false
41
- - sdk : stable
42
- task : ./tool/analyze-and-test-examples.sh
43
- experimental : false
30
+ sdk : [stable, beta, dev]
44
31
steps :
45
32
- uses : actions/checkout@v2
46
33
with :
47
- # submodules param for checkout action to get site-shared, 'true' might be enough
48
- submodules : " recursive"
49
- - run : mkdir -p $TMP
50
- - uses : actions/setup-node@v2
51
- with :
52
- node-version : 16
53
- - uses : ruby/setup-ruby@v1
54
- if : contains(matrix.task, 'build.sh')
55
- with :
56
- bundler-cache : true
57
- ruby-version : 2.7.4
58
- - uses : dart-lang/setup-dart@v1.3
34
+ submodules : recursive
35
+ - uses : dart-lang/setup-dart@v1
59
36
with :
60
37
sdk : ${{ matrix.sdk }}
61
- - name : Install node dependencies
62
- # TODO: caching requires a lockfile for node deps, so does npm ci.
63
- run : npm install
64
- - name : Install dart dependencies
65
- run : dart pub get
66
- - run : ./tool/shared/write-ci-info.sh -v
67
- if : contains(matrix.task, 'build.sh')
68
- - run : ${{ matrix.task }}
69
- continue-on-error : ${{ matrix.experimental }}
70
-
71
- # sdk-files-up-to-date:
72
- # runs-on: ubuntu-latest
73
- # if: |
74
- # github.event_name == 'push'
75
- # && github.ref == 'refs/heads/master'
76
- # steps:
77
- # - uses: actions/checkout@v2
78
- # - run: mkdir -p $TMP
79
- # - uses: dart-lang/setup-dart@v1.3
80
- # with:
81
- # sdk: stable
82
- # - run: ./tool/check-diagnostics.sh
83
-
84
- firebase-checks :
85
- runs-on : ubuntu-latest
86
- steps :
87
- - uses : actions/checkout@v2
88
- - run : mkdir -p $TMP
89
- - uses : dart-lang/setup-dart@v1.3
90
- with :
91
- sdk : stable
92
- - run : ./tool/firebase-checks.sh
38
+ - run : dart pub get
39
+ - run : tool/test.sh
40
+ continue-on-error : true
41
+ env :
42
+ DART_CHANNEL : ${{ matrix.sdk }}
93
43
94
44
deploy :
95
- needs : [test, firebase-checks]
45
+ if : ${{ github.event_name == 'push' &&
46
+ github.ref == 'refs/heads/main' &&
47
+ github.repository == 'dart-lang/site-www' }}
48
+ needs : test
96
49
runs-on : ubuntu-latest
97
- if : |
98
- github.event_name == 'push'
99
- && github.ref == 'refs/heads/master'
100
- && github.repository == 'dart-lang/site-www'
50
+ env :
51
+ FIREBASE_TOKEN : ${{ secrets.FIREBASE_TOKEN }}
52
+ FIREBASE_PROJECT : default
101
53
steps :
102
54
- uses : actions/checkout@v2
103
55
with :
104
- # submodules param for checkout action to get site-shared, 'true' might be enough
105
- submodules : " recursive"
106
- - run : mkdir -p $TMP
56
+ submodules : recursive
57
+ - run : make build
107
58
- uses : actions/setup-node@v2
108
59
with :
109
- node-version : 16
110
- - uses : ruby/setup-ruby@v1
111
- with :
112
- bundler-cache : true
113
- ruby-version : 2.7.4
114
- - uses : dart-lang/setup-dart@v1.3
60
+ node-version : ${{ env.NODE_VERSION }}
61
+ - run : npm install -g firebase-tools
62
+ - uses : dart-lang/setup-dart@v1
115
63
with :
116
64
sdk : stable
117
- - name : Install node dependencies
118
- # TOOD: caching requires a lockfile for node deps, so does npm ci.
119
- run : npm install
120
- - name : Install dart dependencies
121
- run : dart pub get
122
- - run : ./tool/shared/write-ci-info.sh -v
123
- - run : ./tool/build.sh
124
- - run : ./tool/before-release.sh
65
+ - run : tool/check-links.sh
125
66
- uses : FirebaseExtended/action-hosting-deploy@v0
126
67
with :
127
68
repoToken : ' ${{ secrets.GITHUB_TOKEN }}'
128
69
firebaseServiceAccount : ' ${{ secrets.FIREBASE_SERVICE_ACCOUNT_DART_DEV }}'
129
70
projectId : dart-dev
130
71
channelId : live
131
72
132
- deploy_preview :
73
+ stage :
74
+ if : ' ${{ github.event.pull_request.head.repo.full_name == github.repository }}'
133
75
needs : test
134
76
runs-on : ubuntu-latest
135
- if : ' ${{ github.event.pull_request.head.repo.full_name == github.repository }}'
136
77
steps :
137
78
- uses : actions/checkout@v2
138
79
with :
139
- # submodules param for checkout action to get site-shared, 'true' might be enough
140
- submodules : " recursive"
141
- - run : mkdir -p $TMP
80
+ submodules : recursive
81
+ - run : make build
142
82
- uses : actions/setup-node@v2
143
83
with :
144
- node-version : 16
145
- - uses : ruby/setup-ruby@v1
146
- with :
147
- bundler-cache : true
148
- ruby-version : 2.7.4
149
- - uses : dart-lang/setup-dart@v1.3
84
+ node-version : ${{ env.NODE_VERSION }}
85
+ - run : npm install -g firebase-tools
86
+ - uses : dart-lang/setup-dart@v1
150
87
with :
151
88
sdk : stable
152
- - name : Install node dependencies
153
- # TOOD: caching requires a lockfile for node deps, so does npm ci.
154
- run : npm install
155
- - name : Install dart dependencies
156
- run : dart pub get
157
- - run : ./tool/shared/write-ci-info.sh -v
158
- - run : ./tool/build.sh
159
- - uses : FirebaseExtended/action-hosting-deploy@0e16177d01e10c4560245404f959e75a9c633533
89
+ - run : tool/check-links.sh
90
+ - uses : FirebaseExtended/action-hosting-deploy@v0
160
91
with :
161
92
repoToken : ' ${{ secrets.GITHUB_TOKEN }}'
162
93
firebaseServiceAccount : ' ${{ secrets.FIREBASE_SERVICE_ACCOUNT_DART_DEV }}'
0 commit comments