Skip to content

Commit 2911c5c

Browse files
authored
chore: removed travis yml and added git action support (#300)
- integrate git actions
1 parent 6ded106 commit 2911c5c

File tree

6 files changed

+141
-73
lines changed

6 files changed

+141
-73
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Reusable action of running integration of production suite
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
FULLSTACK_TEST_REPO:
7+
required: false
8+
type: string
9+
secrets:
10+
CI_USER_TOKEN:
11+
required: true
12+
TRAVIS_COM_TOKEN:
13+
required: true
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
# You should create a personal access token and store it in your repository
21+
token: ${{ secrets.CI_USER_TOKEN }}
22+
repository: 'optimizely/travisci-tools'
23+
path: 'home/runner/travisci-tools'
24+
ref: 'master'
25+
- name: set SDK Branch if PR
26+
if: ${{ github.event_name == 'pull_request' }}
27+
run: |
28+
echo "SDK_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
29+
echo "TRAVIS_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
30+
- name: set SDK Branch if not pull request
31+
if: ${{ github.event_name != 'pull_request' }}
32+
run: |
33+
echo "SDK_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
34+
echo "TRAVIS_BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
35+
- name: Trigger build
36+
env:
37+
SDK: ruby
38+
FULLSTACK_TEST_REPO: ${{ inputs.FULLSTACK_TEST_REPO }}
39+
BUILD_NUMBER: ${{ github.run_id }}
40+
TESTAPP_BRANCH: master
41+
GITHUB_TOKEN: ${{ secrets.CI_USER_TOKEN }}
42+
TRAVIS_EVENT_TYPE: ${{ github.event_name }}
43+
GITHUB_CONTEXT: ${{ toJson(github) }}
44+
TRAVIS_REPO_SLUG: ${{ github.repository }}
45+
TRAVIS_PULL_REQUEST_SLUG: ${{ github.repository }}
46+
UPSTREAM_REPO: ${{ github.repository }}
47+
TRAVIS_COMMIT: ${{ github.sha }}
48+
TRAVIS_PULL_REQUEST_SHA: ${{ github.event.pull_request.head.sha }}
49+
TRAVIS_PULL_REQUEST: ${{ github.event.pull_request.number }}
50+
UPSTREAM_SHA: ${{ github.sha }}
51+
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
52+
EVENT_MESSAGE: ${{ github.event.message }}
53+
HOME: 'home/runner'
54+
run: |
55+
echo "$GITHUB_CONTEXT"
56+
home/runner/travisci-tools/trigger-script-with-status-update.sh

.github/workflows/lint_markdown.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Reusable action of linting markdown files
2+
3+
on: [workflow_call]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Set up Ruby
11+
uses: ruby/setup-ruby@v1
12+
with:
13+
ruby-version: '2.6'
14+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
15+
- name: Install gem
16+
run: |
17+
gem install awesome_bot
18+
- name: Run tests
19+
run: find . -type f -name '*.md' -exec awesome_bot {} \;

.github/workflows/ruby.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Ruby
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
lint_markdown_files:
11+
uses: optimizely/ruby-sdk/.github/workflows/lint_markdown.yml@master
12+
13+
integration_tests:
14+
uses: optimizely/ruby-sdk/.github/workflows/integration_test.yml@master
15+
secrets:
16+
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}
17+
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
18+
19+
fullstack_production_suite:
20+
uses: optimizely/ruby-sdk/.github/workflows/integration_test.yml@master
21+
with:
22+
FULLSTACK_TEST_REPO: ProdTesting
23+
secrets:
24+
CI_USER_TOKEN: ${{ secrets.CI_USER_TOKEN }}
25+
TRAVIS_COM_TOKEN: ${{ secrets.TRAVIS_COM_TOKEN }}
26+
27+
unit_tests:
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
ruby: [ '2.3.7', '2.4.4', '2.5.1', '2.6.0' ]
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: Set up Ruby ${{ matrix.ruby }}
35+
uses: ruby/setup-ruby@v1
36+
with:
37+
ruby-version: ${{ matrix.ruby }}
38+
bundler-cache: true
39+
- name: Run linting
40+
run: |
41+
bundle exec rubocop
42+
- name: Run unit tests
43+
run: |
44+
bundle exec rake spec
45+
- name: Run coveralls
46+
run: |
47+
bundle exec coveralls
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Source clear
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
schedule:
7+
# Runs "weekly"
8+
- cron: '0 0 * * 0'
9+
10+
jobs:
11+
source_clear:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Source clear scan
16+
env:
17+
SRCCLR_API_TOKEN: ${{ secrets.SRCCLR_API_TOKEN }}
18+
run: curl -sSL https://download.sourceclear.com/ci.sh | bash -s - scan

.travis.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

optimizely-sdk.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
1717
spec.require_paths = ['lib']
1818

1919
spec.add_development_dependency 'bundler'
20-
spec.add_development_dependency 'coveralls'
20+
spec.add_development_dependency 'coveralls_reborn'
2121
spec.add_development_dependency 'rake'
2222
spec.add_development_dependency 'rspec'
2323
spec.add_development_dependency 'rubocop', '0.73.0'

0 commit comments

Comments
 (0)