-
-
Notifications
You must be signed in to change notification settings - Fork 426
Migrate from Travis to Github Actions #3092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
17c6a8b
Add Github Action for running Selenium tests on Chrome
lenacohen c9dc565
Run on pushes to this feature branch for testing purposes
lenacohen 176136e
Remove dot command to source run_travis script
lenacohen 9838602
Debug: check for chromedriver in run_travis.sh
lenacohen 78fc553
Try adding unique --user-data-dir option to Chrome webdriver
lenacohen 21a47ad
Switch to tempfile.TemporaryDirectory()
lenacohen 3cbd0d8
Add matrix for multiple browser jobs and test Firefox and Edge Beta i…
lenacohen ea7917d
Add debugging print statements to Firefox install, and add explicit u…
lenacohen aae8332
Check for and remove snap package
lenacohen b9e968b
Switch to ubuntu 22.04 to match Travis jammy distro
lenacohen 467c45a
Try existing github actions for firefox and geckodriver setup
lenacohen 8262f29
Fix combined step error
lenacohen 34607fd
Add lint job
lenacohen 56571bd
Temporarily remove Edge tests
lenacohen 771cb7c
Try headless option and enable trace logging for geckodriver
lenacohen c6a6c1b
Add jobs for other versions of Firefox
lenacohen 0ae7159
Try Firefox tests without headless argument
lenacohen 5cda133
Add Edge Beta tests
lenacohen 912f09e
Try adding --edge-skip-compat-layer-relaunch flag
lenacohen bf922a6
Try making edge headless
lenacohen 57db217
Add Chrome stable and beta tests
lenacohen 32e505a
Use headless Chrome
lenacohen 337601d
Check installed path
lenacohen 162c25b
Only verify Chrome Installation for Chrome
lenacohen f6536b2
Add missing step id
lenacohen 81670f1
Overwrite system Chrome to fix Chrome Driver and Chrome version incom…
lenacohen 25e762e
Overwrite version-specific system chrome
lenacohen fa8e695
Separate Github Action changes from Travis code
lenacohen dce23d1
Limit headless mode argument to Github Actions
lenacohen c61c90b
Run on pushes to mv3-chrome branch and restore color
lenacohen fd8dff5
Address PR feedback to simplify the config and remove Chrome steps fr…
lenacohen 3b2eac0
Remove Travis code and references
lenacohen 0abef94
Fix missing steps
lenacohen 137985a
Remove Travis references from pbtest
lenacohen ebc7eea
Switch from --headless to Xvfb
lenacohen 52dfebc
Restore branch limit to trigger runs only on pushes to master
lenacohen ab3314b
Tweak lint job
ghostwords e81971b
Restore ChromeDriver script (useful for local dev)
ghostwords b1e1b34
Tweak Selenium tests job
ghostwords fa21053
Tweak lint job name
ghostwords 9b1b2c1
Tweak testing doc
ghostwords 63d30ed
chmod +x chromedriver.sh
ghostwords 1712190
Add a Geckodriver install script for local dev
ghostwords ebdf2c8
Remove stray Travis refs
ghostwords 8ce250b
Mega nits
ghostwords File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 'lts/*' | ||
| - name: Run ESLint | ||
| run: | | ||
| # "--production" to skip installing devDependencies modules | ||
| npm ci --production || exit 1 | ||
| make lint | ||
|
|
||
| selenium: | ||
| runs-on: ubuntu-22.04 | ||
| continue-on-error: true | ||
| strategy: | ||
| matrix: | ||
| job: [firefox, firefox-beta, firefox-nightly, firefox-esr, edge-beta] | ||
| include: | ||
| - job: firefox | ||
| INFO: "Firefox" | ||
| BROWSER: "firefox" | ||
| FIREFOX_VERSION: "latest" | ||
| - job: firefox-beta | ||
| INFO: "Firefox Beta" | ||
| BROWSER: "firefox" | ||
| FIREFOX_VERSION: "latest-beta" | ||
| - job: firefox-nightly | ||
| INFO: "Firefox Nightly" | ||
| BROWSER: "firefox" | ||
| FIREFOX_VERSION: "latest-nightly" | ||
| - job: firefox-esr | ||
| INFO: "Firefox ESR" | ||
| BROWSER: "firefox" | ||
| FIREFOX_VERSION: "latest-esr" | ||
| - job: edge-beta | ||
| INFO: "Edge Beta" | ||
| BROWSER: "microsoft-edge-beta" | ||
|
|
||
| env: | ||
| INFO: ${{ matrix.INFO }} | ||
| BROWSER: ${{ matrix.BROWSER }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Install Python dependencies | ||
| run: pip install -r tests/requirements.txt | ||
|
|
||
| - name: Set up Firefox | ||
| if: ${{ matrix.BROWSER == 'firefox' }} | ||
| uses: browser-actions/setup-firefox@v1 | ||
| with: | ||
| firefox-version: ${{ matrix.FIREFOX_VERSION }} | ||
|
|
||
| - name: Install Geckodriver | ||
| if: ${{ matrix.BROWSER == 'firefox' }} | ||
| uses: browser-actions/setup-geckodriver@latest | ||
|
|
||
| - name: Set up Edge | ||
| if: ${{ matrix.BROWSER == 'microsoft-edge-beta' }} | ||
| uses: browser-actions/setup-edge@v1 | ||
| with: | ||
| edge-version: beta | ||
|
|
||
| - name: Install Edge WebDriver | ||
| if: ${{ matrix.BROWSER == 'microsoft-edge-beta' }} | ||
| run: ./scripts/edge_webdriver.sh | ||
|
|
||
| - name: Install Xvfb | ||
| run: sudo apt-get install -y xvfb | ||
|
|
||
| - name: Run Tests | ||
| run: | | ||
| type "$BROWSER" >/dev/null 2>&1 || { | ||
| echo "$BROWSER seems to be missing!" | ||
| exit 1 | ||
| } | ||
| echo "Found $("$BROWSER" --version)" | ||
| xvfb-run --auto-servernum pytest --capture=no --color=yes --verbose --durations=10 tests/selenium | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| edge_version_major=$(microsoft-edge-beta --product-version | cut -d . -f 1) | ||
| edgedriver_version_url="https://msedgedriver.azureedge.net/LATEST_RELEASE_${edge_version_major}_LINUX" | ||
| edgedriver_version=$(curl -s "$edgedriver_version_url" | tr -d "\0\r\n" | cut -c 3-) | ||
| if [ -z "$edgedriver_version" ]; then | ||
| echo "Failed to retrieve Edge WebDriver version!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Installing Edge WebDriver version $edgedriver_version ..." | ||
| wget "https://msedgedriver.azureedge.net/${edgedriver_version}/edgedriver_linux64.zip" | ||
| unzip edgedriver_linux64.zip | ||
| sudo mv msedgedriver /usr/local/bin/ | ||
| sudo chmod a+x /usr/local/bin/msedgedriver | ||
|
|
||
| # check that Edge WebDriver is now present | ||
| type msedgedriver >/dev/null 2>&1 || { | ||
| echo "Failed to install Edge WebDriver" | ||
| exit 1 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # Install the latest version of geckodriver | ||
| version=$(curl -sI https://github.com/mozilla/geckodriver/releases/latest | grep -i "^Location: " | sed 's/.*\///' | tr -d '\r') | ||
|
|
||
| # check that we got something | ||
| if [ -z "$version" ]; then | ||
| echo "Failed to determine the latest Geckodriver version!" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Geckodriver distribution is MacOS or Linux specific | ||
| os="$(uname -s)" | ||
| if [[ $os == "Darwin" ]]; then | ||
| os_dist="macos.tar.gz" | ||
| else | ||
| os_dist="linux64.tar.gz" | ||
| fi | ||
|
|
||
| echo "Setting up Geckodriver version $version ..." | ||
| url="https://github.com/mozilla/geckodriver/releases/download/${version}/geckodriver-${version}-${os_dist}" | ||
| wget -q -O /tmp/geckodriver.tar.gz "$url" | ||
| sudo tar -xvf /tmp/geckodriver.tar.gz -C /usr/local/bin/ | ||
| sudo chmod a+x /usr/local/bin/geckodriver | ||
|
|
||
| # check that geckodriver is now present | ||
| type geckodriver >/dev/null 2>&1 || { | ||
| echo "Failed to install Geckodriver" | ||
| exit 1 | ||
| } |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.