Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/hosted-execution.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Ruby Hosted Execution

on:
push:
branches: [ master ]
pull_request:

jobs:
# Build the project as a Docker image and push it to Docker Hub
push_to_registry:
name: Build and push Docker image to Docker Hub
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.meta.outputs.tags }}
label: ${{ steps.meta.outputs.labels }}
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: danielpatrickgraham # TODO: Do not merge this into saucelaabs-training -- no hardcoding
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: danielpatrickgraham/demo-ruby-2 # TODO: Do not merge this into saucelabs-training -- no hardcoding
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: ./Dockerfile

run-tests:
name: Run Tests in Sauce Labs hosted execution environment
needs: push_to_registry
runs-on: ubuntu-latest
container: saucelabs/saucectl:latest
strategy:
fail-fast: false
matrix:
entrypoint: [
"sh -c 'cd sauce-features/accessibility; bundle exec rake;'",
"sh -c 'cd selenium-examples/rspec; bundle exec rake;'",
]
steps:
- uses: actions/checkout@v2
- name: Run tests
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
DOCKER_USERNAME: danielpatrickgraham # TODO: Unhardcode this when merge to saucelabs-training
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_TAG: ${{ needs.push_to_registry.outputs.tag }}
ENTRYPOINT: ${{ matrix.entrypoint }}
run: saucectl run
11 changes: 11 additions & 0 deletions .sauce/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1alpha
kind: imagerunner
sauce:
region: us-west-1
suites:
- name: Desktop Tests
image: $DOCKER_TAG
imagePullAuth:
user: $DOCKER_USERNAME
token: $DOCKER_PASSWORD
entrypoint: $ENTRYPOINT
31 changes: 28 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
FROM ruby:2.5
FROM ruby:3
COPY './training-sessions/intro/Gemfile' './training-sessions/intro/'
COPY './training-sessions/selenium4/Gemfile' './training-sessions/selenium4/Gemfile.lock' './training-sessions/selenium4/'
COPY './sauce-features/visual/Gemfile' './sauce-features/visual/'
COPY './sauce-features/accessibility/Gemfile' './sauce-features/accessibility/'
#COPY './selenium-examples/capybara-rspec/Gemfile' './selenium-examples/capybara-rspec/Gemfile.lock' './'
COPY './selenium-examples/cucumber/Gemfile' './selenium-examples/cucumber/Gemfile.lock' './selenium-examples/cucumber/'
COPY './selenium-examples/watir-rspec/Gemfile' './selenium-examples/watir-rspec/Gemfile.lock' './selenium-examples/watir-rspec/'
#COPY './selenium-examples/capybara-cucumber/Gemfile' './selenium-examples/capybara-cucumber/Gemfile.lock' './'
COPY './selenium-examples/rspec/Gemfile' './selenium-examples/rspec/Gemfile.lock' './selenium-examples/rspec/'
COPY './selenium-examples/watir-cucumber/Gemfile' './selenium-examples/watir-cucumber/Gemfile.lock' './selenium-examples/watir-cucumber/'
COPY './appium-examples/Cucumber/emusim/Gemfile' './appium-examples/Cucumber/emusim/'
COPY './appium-examples/RSpec/emusim/Gemfile' './appium-examples/RSpec/emusim/Gemfile.lock' './appium-examples/RSpec/emusim/'
COPY './appium-examples/RSpec/rdc/Gemfile' './appium-examples/RSpec/rdc/Gemfile.lock' './appium-examples/RSpec/rdc/'
RUN BUNDLE_GEMFILE='./training-sessions/intro/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./training-sessions/selenium4/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./sauce-features/visual/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./sauce-features/accessibility/Gemfile' bundle install
#RUN BUNDLE_GEMFILE='./selenium-examples/capybara-rspec/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./selenium-examples/cucumber/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./selenium-examples/watir-rspec/Gemfile' bundle install
#RUN BUNDLE_GEMFILE='./selenium-examples/capybara-cucumber/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./selenium-examples/rspec/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./selenium-examples/watir-cucumber/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./appium-examples/Cucumber/emusim/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./appium-examples/RSpec/emusim/Gemfile' bundle install
RUN BUNDLE_GEMFILE='./appium-examples/RSpec/rdc/Gemfile' bundle install
COPY . .
WORKDIR /demo-ruby
CMD [""]
CMD [""]