forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (138 loc) · 4.44 KB
/
bazel.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
name: Bazel
on:
workflow_call:
inputs:
name:
description: Name of workflow
required: false
type: string
run:
description: Bazel command to run
required: true
type: string
os:
description: One of ubuntu, windows or macos
required: false
type: string
default: ubuntu
browser:
description: One of chrome, firefox, or edge
required: false
type: string
default: ''
browser-version:
description: One of stable, latest, latest-beta or latest-devedition
required: false
type: string
default: ''
cache-key:
description: Bazel disk cache key
required: false
type: string
default: ''
java-version:
description: Custom Java version to install
required: false
type: string
default: ''
ruby-version:
description: Custom Ruby version to use
required: false
type: string
default: ''
nightly-release-files:
description: Files to upload to the Nightly release tag
required: false
type: string
default: ''
jobs:
bazel:
name: ${{ inputs.name }}
runs-on: ${{ inputs.os }}-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SEL_M2_USER: ${{ secrets.SEL_M2_USER }}
SEL_M2_PASS: ${{ secrets.SEL_M2_PASS }}
steps:
- name: Checkout source tree
uses: actions/checkout@v4
- name: Free space
if: inputs.os != 'windows'
run: ./scripts/github-actions/free-disk-space.sh
- name: Remove driver directories Windows
if: inputs.os == 'windows'
run: |
rm "$env:ChromeWebDriver" -r -v
rm "$env:EdgeWebDriver" -r -v
rm "$env:GeckoWebDriver" -r -v
- name: Remove driver directories Non-Windows
if: inputs.os != 'windows'
run: |
sudo rm -rf $CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER
- name: Set Ruby version
if: inputs.ruby-version != ''
run: echo 'RUBY_VERSION = "${{ inputs.ruby-version }}"' > rb/ruby_version.bzl
- name: Setup Java
if: inputs.java-version != ''
uses: actions/setup-java@v3
with:
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
- name: Setup Bazel
uses: p0deje/[email protected]
with:
bazelisk-cache: true
disk-cache: ${{ inputs.cache-key }}
external-cache: |
name: ${{ inputs.cache-key }}
manifest:
crates: rust/Cargo.Bazel.lock
npm: package-lock.json
pypi__pip: py/requirements_lock.txt
rules_ruby_dist: rb/ruby_version.bzl
repository-cache: true
- name: Setup Fluxbox and Xvfb
if: inputs.os == 'ubuntu' && inputs.browser != ''
run: |
sudo apt-get -y install fluxbox
Xvfb :99 &
fluxbox -display :99 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Set resolution
if: inputs.os == 'windows' && inputs.browser != ''
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
- name: Setup Chrome
if: inputs.browser == 'chrome'
uses: browser-actions/setup-chrome@latest
with:
chrome-version: ${{ inputs.browser-version || 'stable' }}
- name: Setup Firefox
if: inputs.browser == 'firefox'
uses: abhi1693/[email protected]
with:
browser: firefox
version: ${{ inputs.browser-version || 'latest' }}
- name: Setup Edge
if: inputs.browser == 'edge'
uses: browser-actions/setup-edge@latest
with:
edge-version: ${{ inputs.browser-version || 'stable' }}
- name: Setup Safari
if: inputs.browser == 'safari'
run: sudo safaridriver --enable
- name: Run Bazel
run: ${{ inputs.run }}
- name: Start SSH session
if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: false
- name: Release Nightly
if: inputs.nightly-release-files != ''
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "nightly"
title: "Nightly"
prerelease: true
files: ${{ inputs.nightly-release-files }}