-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github actions and gitignore file
- Loading branch information
Showing
4 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,11 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../generator' | ||
|
||
class ActionsGenerator < Generator | ||
def generate_actions_file | ||
return unless web? | ||
|
||
template('templates/actions.tt', "#{name}/.github/workflows/test_pipeline.yml") | ||
end | ||
end |
This file contains 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,64 @@ | ||
name: <%- if framework == 'cucumber' -%>Cucumber Tests<%- else -%>Rspec Tests<%- end -%> | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
browser: | ||
type: choice | ||
description: Which browser to test | ||
required: true | ||
options: | ||
- chrome | ||
|
||
jobs: | ||
build: | ||
name: CI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.1.0 | ||
bundler-cache: true | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install gems | ||
run: bundle install | ||
|
||
- name: Create allure-results folder | ||
run: mkdir -p allure-results | ||
|
||
- name: Create screenshots folder | ||
run: mkdir -p allure-results/screenshots | ||
|
||
- name: Build and test with rspec | ||
run: <%- if framework == 'cucumber' -%>cucumber features --format pretty <%- else -%>bundle exec rspec spec --format documentation<%- end -%> | ||
|
||
- name: Get Allure history | ||
uses: actions/checkout@v2 | ||
if: always() | ||
continue-on-error: true | ||
with: | ||
ref: gh-pages | ||
path: gh-pages | ||
|
||
- name: Allure Report | ||
uses: simple-elf/allure-report-action@master | ||
if: always() | ||
id: allure-report | ||
with: | ||
allure_results: allure-results | ||
gh_pages: gh-pages | ||
allure_report: allure-report | ||
allure_history: allure-history | ||
|
||
- name: Deploy report to Github Pages | ||
if: always() | ||
uses: peaceiris/actions-gh-pages@v2 | ||
env: | ||
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PUBLISH_BRANCH: gh-pages | ||
PUBLISH_DIR: allure-history |
This file contains 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 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 @@ | ||
allure-results |