-
Notifications
You must be signed in to change notification settings - Fork 370
65 lines (56 loc) · 2.35 KB
/
web_tests.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
name: Continuous Integration Web Tests
# Needed for gcloud because as of Nov 2022, gcloud only supports python 3.5-3.9
# https://cloud.google.com/sdk/docs/install#supported_python_versions
# https://github.com/google-github-actions/setup-gcloud/issues/381#issuecomment-955631107
# ubuntu-20.04 comes with python3.8. As a result, we can tell gcloud to use that.
env:
CLOUDSDK_PYTHON: python3.8
on:
push:
branches:
- main
pull_request:
jobs:
web_tests:
# Need to use 20.04 because ubuntu-latest uses ubuntu-22.04.
# 22.04 comes with python 3.10 and that does not work with gcloud.
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
# Refer to CLOUDSDK_PYTHON above for more details.
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [18.x]
# TODO: Add 14.x, 16.x.
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: pre-installation
run: |
# Remove existing google-cloud-sdk packages in Ubuntu.
sudo rm -rf /usr/lib/google-cloud-sdk
curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-410.0.0-linux-x86_64.tar.gz | tar -zx > /dev/null
# Substitute the downloaded google-cloud-sdk packages, due to https://stackoverflow.com/questions/42697026/install-google-cloud-components-error-from-gcloud-command.
sudo mv google-cloud-sdk /usr/lib/
sudo gcloud components update
sudo gcloud components install app-engine-python beta cloud-datastore-emulator app-engine-python-extras
gcloud config set project cr-status-staging
gcloud version
- name: installation
run: |
npm install -g gulp
- run: npm config set script-shell bash --global
- run: npm run setup
- name: Install playwright browsers
run: npx playwright install --with-deps
- run: npm run build --if-present
- name: Run web test runner
run: npm run webtest