Skip to content

chore: removed travis yml and added git action support #300

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 24 commits into from
Apr 28, 2022
Merged
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
56 changes: 56 additions & 0 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Reusable action of running integration of production suite

on:
workflow_call:
inputs:
FULLSTACK_TEST_REPO:
required: false
type: string
secrets:
CI_USER_TOKEN:
required: true
TRAVIS_COM_TOKEN:
required: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# You should create a personal access token and store it in your repository
token: ${{ secrets.CI_USER_TOKEN }}
repository: 'optimizely/travisci-tools'
path: 'home/runner/travisci-tools'
ref: 'master'
- name: set SDK Branch if PR
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
echo "TRAVIS_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove it.

- name: set SDK Branch if not pull request
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "SDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Trigger build
env:
SDK: ruby
FULLSTACK_TEST_REPO: ${{ inputs.FULLSTACK_TEST_REPO }}
BUILD_NUMBER: ${{ github.run_id }}
TESTAPP_BRANCH: master
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
TRAVIS_EVENT_TYPE: ${{ github.event_name }}
GITHUB_CONTEXT: ${{ toJson(github) }}
TRAVIS_REPO_SLUG: ${{ github.repository }}
TRAVIS_PULL_REQUEST_SLUG: ${{ github.repository }}
UPSTREAM_REPO: ${{ github.repository }}
TRAVIS_COMMIT: ${{ github.sha }}
TRAVIS_PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }}
TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }}
UPSTREAM_SHA: ${{ github.sha }}
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
EVENT_MESSAGE: ${{ github.event.message }}
HOME: 'home/runner'
run: |
echo "$GITHUB_CONTEXT"
home/runner/travisci-tools/trigger-script-with-status-update.sh
19 changes: 19 additions & 0 deletions .github/workflows/lint_markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Reusable action of linting markdown files

on: [workflow_call]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Install gem
run: |
gem install awesome_bot
- name: Run tests
run: find . -type f -name '*.md' -exec awesome_bot {} \;
47 changes: 47 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Ruby

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
lint_markdown_files:
uses: optimizely/ruby-sdk/.github/workflows/lint_markdown.yml@master

integration_tests:
uses: optimizely/ruby-sdk/.github/workflows/integration_test.yml@master
secrets:
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}

fullstack_production_suite:
uses: optimizely/ruby-sdk/.github/workflows/integration_test.yml@master
with:
FULLSTACK_TEST_REPO: ProdTesting
secrets:
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}

unit_tests:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: [ '2.3.7', '2.4.4', '2.5.1', '2.6.0' ]
steps:
- uses: actions/checkout@v3
- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Run linting
run: |
bundle exec rubocop
- name: Run unit tests
run: |
bundle exec rake spec
- name: Run coveralls
run: |
bundle exec coveralls
18 changes: 18 additions & 0 deletions .github/workflows/source_clear_crone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Source clear

on:
push:
branches: [ master ]
schedule:
# Runs "weekly"
- cron: '0 0 * * 0'

jobs:
source_clear:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Source clear scan
env:
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }}
run: curl -sSL https://download.sourceclear.com/ci.sh | bash -s - scan
72 changes: 0 additions & 72 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion optimizely-sdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'coveralls'
spec.add_development_dependency 'coveralls_reborn'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason to change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coveralls is last updated on Sep 9, 2021 and a newer and updated fork is coveralls_reborn. Coveralls is also not supported with git actions.

spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'rubocop', '0.73.0'
Expand Down