Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 49885c5

Browse files
committed
Change travis CI to GH actions
1 parent b345669 commit 49885c5

File tree

4 files changed

+142
-2
lines changed

4 files changed

+142
-2
lines changed

.github/action/action.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: "Set up"
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Checkout twilio-api-faker
7+
uses: actions/checkout@v2
8+
with:
9+
repository: TwilioDevEd/twilio-api-faker
10+
path: twilio-api-faker
11+
- name: Setup Ruby 2.6
12+
uses: ruby/setup-ruby@v1
13+
with:
14+
ruby-version: 2.6
15+
- name: Install general dependencies
16+
run: |
17+
sudo apt-get install -y --force-yes build-essential ca-certificates curl
18+
gem install json colorize nokogiri rubocop
19+
sudo cp twilio-api-faker/keystore/twilio_fake.pem /usr/local/share/ca-certificates/twilio_fake.crt
20+
sudo update-ca-certificates
21+
shell: bash

.github/workflows/build_test.yml

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Build and test snippets
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
env:
12+
FAKE_CERT_PATH: ~/build/TwilioDevEd/api-snippets/twilio-api-faker/keystore/twilio_fake.pem
13+
GRADLE_OPTS: "-Dorg.gradle.daemon=true"
14+
BASH: /bin/bash
15+
BASH_SOURCE: /usr/local/bin/virtualenvwrapper.sh
16+
17+
jobs:
18+
# python:
19+
# runs-on: ubuntu-latest
20+
21+
# steps:
22+
# - uses: actions/checkout@v2
23+
# - uses: ./.github/action
24+
# - name: Set up Python 3.6
25+
# uses: actions/setup-python@v2
26+
# with:
27+
# python-version: 3.6
28+
# - name: Install dependencies
29+
# run: |
30+
# python -m pip install --upgrade pip
31+
# pip install wheel virtualenv virtualenvwrapper
32+
# pip install -r requirements.txt
33+
# - name: Run Tests
34+
# run: |
35+
# echo "Run api faker"
36+
# ./run_twilio_api_faker.sh
37+
# echo "Running tests"
38+
# ruby tools/snippet-testing/snippet_tester.rb -i
39+
# env:
40+
# SNIPPET_LANGUAGE: python
41+
42+
# curl:
43+
# runs-on: ubuntu-latest
44+
45+
# steps:
46+
# - uses: actions/checkout@v2
47+
# - uses: ./.github/action
48+
# - name: Run Tests
49+
# run: |
50+
# ./run_twilio_api_faker.sh
51+
# ruby tools/snippet-testing/snippet_tester.rb -i
52+
# env:
53+
# SNIPPET_LANGUAGE: curl
54+
55+
# node:
56+
# runs-on: ubuntu-latest
57+
58+
# steps:
59+
# - uses: actions/checkout@v2
60+
# - uses: ./.github/action
61+
# - uses: actions/setup-node@v2
62+
# with:
63+
# node-version: '14'
64+
# - run: npm install
65+
# - name: Run Tests
66+
# run: |
67+
# ./run_twilio_api_faker.sh
68+
# ruby tools/snippet-testing/snippet_tester.rb -i
69+
# env:
70+
# SNIPPET_LANGUAGE: node
71+
72+
ruby:
73+
runs-on: ubuntu-latest
74+
75+
steps:
76+
- uses: actions/checkout@v2
77+
- uses: ./.github/action
78+
- name: Install rvm
79+
run: |
80+
sudo apt-add-repository -y ppa:rael-gc/rvm
81+
sudo apt-get update
82+
sudo apt-get install rvm
83+
sudo usermod -a -G rvm $USER
84+
- name: Run Tests
85+
run: |
86+
./run_twilio_api_faker.sh
87+
ruby tools/snippet-testing/snippet_tester.rb -i
88+
env:
89+
SNIPPET_LANGUAGE: ruby
90+
91+
# csharp:
92+
# runs-on: ubuntu-latest
93+
94+
# steps:
95+
# - uses: actions/checkout@v2
96+
# - uses: ./.github/action
97+
# - name: Run Tests
98+
# run: |
99+
# ./run_twilio_api_faker.sh
100+
# ruby tools/snippet-testing/snippet_tester.rb -i
101+
# env:
102+
# SNIPPET_LANGUAGE: csharp
103+
104+
# php:
105+
# runs-on: ubuntu-latest
106+
107+
# steps:
108+
# - uses: actions/checkout@v2
109+
# - uses: ./.github/action
110+
# - name: Install PHP
111+
# uses: shivammathur/setup-php@v2
112+
# with:
113+
# php-version: '5.6'
114+
# - name: Run Tests
115+
# run: |
116+
# ./run_twilio_api_faker.sh
117+
# ruby tools/snippet-testing/snippet_tester.rb -i
118+
# env:
119+
# SNIPPET_LANGUAGE: php

.rubocop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AllCops:
2-
TargetRubyVersion: '2.2'
2+
TargetRubyVersion: '2.6'
33
Exclude:
44
- 'testable_snippets/**/*'
55
- '*/testable_snippets/**/*'

tools/snippet-testing/language_handler/python.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Python < BaseHandler
55
LANG_CNAME = 'py'.freeze
66

77
def self.run_before_test(directory)
8-
dirs = ['./venv/*', './guides/*', './testable_snippets/*']
8+
dirs = ['venv/*', 'guides/*', 'testable_snippets/*']
99
exclude = dirs.map{|dir| "--exclude='#{dir}'"}
1010
Dir.chdir(directory) do
1111
output = `yapf #{exclude.join(' ')} -i -r . && flake8`

0 commit comments

Comments
 (0)