Skip to content

Commit

Permalink
Fixing compilation error on Windows. (#33)
Browse files Browse the repository at this point in the history
* Fixing compilation error on Windows. Also updates the CI to include Windows. Fixes #31

* bump ameba. It was locking up while building on windows, but maybe it was the version

* See if we can skip the ameba postinstall during specs

* Install Chrome on Windows

* Trying to see where chrome is being installed

* useless commit because GithubActions seems to not be picking up my last commit...

* that was throwing syntax errors, so removing it

* Bump webdrivers version

* Process with args and shell: true is not supported on Windows
  • Loading branch information
jwoertink authored Jul 1, 2023
1 parent ca2daa6 commit cafdff4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 27 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ on:
branches: [ master ]

jobs:
check-format:
check_format:
strategy:
fail-fast: false
runs-on: ubuntu-latest
continue-on-error: false
steps:
- uses: actions/checkout@v1
- name: Download source
uses: actions/checkout@v3
- name: Install Crystal
uses: oprypin/install-crystal@v1
with:
crystal: latest
uses: crystal-lang/install-crystal@v1
- name: Install shards
run: shards install
- name: Format
Expand All @@ -28,20 +30,24 @@ jobs:
include:
- os: ubuntu-latest
crystal: latest
- os: ubuntu-latest
crystal: nightly
- os: windows-latest
crystal: latest
- os: macos-latest
crystal: latest
runs-on: ${{matrix.os}}
runs-on: ${{ matrix.os }}
continue-on-error: false
steps:
- uses: actions/checkout@v2
- name: Install Crystal
uses: oprypin/install-crystal@v1
with:
crystal: ${{matrix.crystal}}
- name: Install dependencies
run: shards install --ignore-crystal-version
- name: Run tests
run: crystal spec --tag "~chrome"
env:
SELENIUM_BROWSER: chrome
- uses: actions/checkout@v3
- uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal_version }}
- uses: browser-actions/setup-chrome@v1
with:
chrome-version: stable
if: matrix.os == 'windows-latest'
- name: Install dependencies
run: shards install --ignore-crystal-version --skip-executables --skip-postinstall
- name: Run tests
run: crystal spec --tag "~chrome"
env:
SELENIUM_BROWSER: chrome
8 changes: 4 additions & 4 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: selenium
version: 0.11.0
authors:
- Matthew McGarvey <[email protected]>
crystal: ">= 0.35.0, < 2.0.0"
crystal: ">= 1.4.0, < 2.0.0"
license: MIT
development_dependencies:
webdrivers:
github: matthewmcgarvey/webdrivers.cr
version: ~> 0.4.1
github: crystal-loot/webdrivers.cr
version: ~> 0.4.2
ameba:
github: crystal-ameba/ameba
version: 1.4.2
version: ~> 1.4.3
12 changes: 8 additions & 4 deletions src/selenium/service.cr
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,22 @@ abstract class Selenium::Service
private def stop_process(process)
return if process.nil? || process.terminated?

process.signal(Signal::KILL)
process.terminate(graceful: false)
end

private def spawn_in_shell?
os != "linux"
os == "macos"
end

private def os
{% if flag?(:linux) %}
{% if flag?(:darwin) %}
"macos"
{% elsif flag?(:win32) %}
"windows"
{% elsif flag?(:linux) %}
"linux"
{% else %}
"macos"
"other"
{% end %}
end
end

0 comments on commit cafdff4

Please sign in to comment.