-
Notifications
You must be signed in to change notification settings - Fork 92
165 lines (158 loc) · 5.32 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: lint
python_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: python_test
go_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: go_test
web_components_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: web_components_test
go_chrome_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: go_chrome_test
go_firefox_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
- uses: ./.github/actions/make-in-docker
with:
target: go_firefox_test
go_cloud_test:
# This job uses real Cloud resources.
# This means this CI job will have access to the service account.
# In that case, similar to deploy.yml, trust only pull requests that are
# made within web-platform-tests and exclude forks.
if: |
(github.repository == 'web-platform-tests/wpt.fyi') &&
((github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'web-platform-tests/wpt.fyi' && github.actor != 'dependabot[bot]') ||
(github.event_name != 'pull_request'))
needs: [go_test, go_chrome_test, go_firefox_test]
runs-on: ubuntu-latest
env:
DOCKER_IMAGE: webplatformtests/wpt.fyi:latest
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: secrets
run: echo "$GCLOUD_KEY_FILE_JSON" > client-secret.json
env:
GCLOUD_KEY_FILE_JSON: ${{ secrets.GCLOUD_KEY_FILE_JSON }}
- name: Set DOCKER_INSTANCE
run: echo "DOCKER_INSTANCE=wptd-dev-$(echo $RANDOM)" >> $GITHUB_ENV
- name: Docker config check
uses: dorny/paths-filter@v3
id: dockerchanges
with:
filters: |
dockerconf:
- 'Dockerfile'
# run only if Docker configuration was changed
- if: steps.dockerchanges.outputs.dockerconf == 'true'
name: Rebuild Docker image
run: docker build -t webplatformtests/wpt.fyi:latest .
# run only if Docker configuration was not changed
- if: steps.dockerchanges.outputs.dockerconf == 'false'
name: Fetch latest Docker image
run: docker pull "${DOCKER_IMAGE}"
- name: pre-installation
run: bash ./util/docker-dev/run.sh -d -q
- name: run tests with "cloud" build tag
run: docker exec -t "${DOCKER_INSTANCE}" make go_cloud_test;