Skip to content

Commit

Permalink
added github actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
newapplesho committed Aug 10, 2024
1 parent 54f504c commit c0b4d83
Show file tree
Hide file tree
Showing 12 changed files with 202 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
time: "13:00"
timezone: "Asia/Tokyo"
reviewers:
- "newapplesho"
commit-message:
prefix: "ci"
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ci

run-name: "[${{ github.event.repository.name }}] Check: ${{ github.event_name == 'schedule' && 'scheduled' || github.event.pull_request.title }}"

on:
pull_request:
types: [opened, synchronize, reopened]
schedule:
- cron: "0 21 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
smalltalk: [ Pharo64-7.0, Pharo64-8.0, Pharo64-9.0, Pharo64-10, Pharo64-11, Pharo64-12 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v3
- name: Set up Smalltalk CI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load Image and Run Tests
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalk.ston
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 15
7 changes: 5 additions & 2 deletions .smalltalk.ston
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Twilio',
#directory : 'pharo-repository',
#directory : './pharo-repository',
#load : [ 'CI' ],
#platforms : [ #pharo ]
}
],
#testing : {
#failOnZeroTests : false
#coverage : {
#packages : [ 'Twilio*' ]
}
}
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# twilio-smalltalk

[![ci](https://github.com/newapplesho/twilio-smalltalk/actions/workflows/ci.yml/badge.svg)](https://github.com/newapplesho/twilio-smalltalk/actions/workflows/ci.yml)

A Smalltalk library for communicating with the Twilio REST API ([http://twilio.com](http://twilio.com)).

# Supported Smalltalk Versions
Expand Down
8 changes: 7 additions & 1 deletion pharo-repository/BaselineOfTwilio/BaselineOfTwilio.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ BaselineOfTwilio >> baseline: spec [
spec for: #common do: [
spec baseline: 'NeoJSON' with: [ spec repository: 'github://svenvc/NeoJSON/repository' ].
spec
package: 'Twilio-REST-Core'.
package: 'Twilio-REST-Core' with: [ spec requires: #('NeoJSON') ];
package: 'Twilio-REST-Core-Tests' with: [ spec requires: #( 'Twilio-REST-Core' ) ].

spec
group: 'Core' with: #( 'Twilio-REST-Core');
group: 'Tests' with: #( 'Twilio-REST-Core-Tests' );
group: 'CI' with: #( 'Tests' ).
].
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"
A TwilioAccountsTest is a test class for testing the behavior of TwilioAccounts
"
Class {
#name : #TwilioAccountsTest,
#superclass : #TwilioInstanceResourceTest,
#category : #'Twilio-REST-Core-Tests-Base'
}

{ #category : #'accessing - defaults' }
TwilioAccountsTest >> defaultTestClass [
^ TwilioAccounts
]

{ #category : #tests }
TwilioAccountsTest >> testResourceUrl [

self assert: (instance resourceUrl asString beginsWith: 'https://api.twilio.com/2010-04-01/Accounts')
]
19 changes: 19 additions & 0 deletions pharo-repository/Twilio-REST-Core-Tests/TwilioCallsTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"
A TwilioCallsTest is a test class for testing the behavior of TwilioCalls
"
Class {
#name : #TwilioCallsTest,
#superclass : #TwilioInstanceResourceTest,
#category : #'Twilio-REST-Core-Tests-Base'
}

{ #category : #'accessing - defaults' }
TwilioCallsTest >> defaultTestClass [
^ TwilioCalls
]

{ #category : #tests }
TwilioCallsTest >> testResourceUrl [
self assert: (instance resourceUrl asString beginsWith: 'https://api.twilio.com/2010-04-01/Accounts').
self assert: (instance resourceUrl asString endsWith: 'Calls.json')
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"
A TwilioInstanceResourceTest is a test class for testing the behavior of TwilioInstanceResource
"
Class {
#name : #TwilioInstanceResourceTest,
#superclass : #TestCase,
#instVars : [
'instance'
],
#category : #'Twilio-REST-Core-Tests-Base'
}

{ #category : #testing }
TwilioInstanceResourceTest class >> isAbstract [
^ self == TwilioInstanceResourceTest
]

{ #category : #'accessing - defaults' }
TwilioInstanceResourceTest >> defaultTestClass [
^ self subclassResponsibility
]

{ #category : #running }
TwilioInstanceResourceTest >> setUp [
super setUp.
instance := self defaultTestClass new

]

{ #category : #running }
TwilioInstanceResourceTest >> tearDown [
instance := nil.
super tearDown
]

{ #category : #tests }
TwilioInstanceResourceTest >> testResourceUrl [
self subclassResponsibility
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"
A TwilioMessagesTest is a test class for testing the behavior of TwilioMessages
"
Class {
#name : #TwilioMessagesTest,
#superclass : #TwilioInstanceResourceTest,
#category : #'Twilio-REST-Core-Tests-Base'
}

{ #category : #'accessing - defaults' }
TwilioMessagesTest >> defaultTestClass [
^ TwilioMessages
]

{ #category : #tests }
TwilioMessagesTest >> testResourceUrl [

self assert: (instance resourceUrl asString beginsWith: 'https://api.twilio.com/2010-04-01/Accounts').
self assert: (instance resourceUrl asString endsWith: 'Messages.json')
]
20 changes: 20 additions & 0 deletions pharo-repository/Twilio-REST-Core-Tests/TwilioRecordsTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"
A TwilioRecordsTest is a test class for testing the behavior of TwilioRecords
"
Class {
#name : #TwilioRecordsTest,
#superclass : #TwilioInstanceResourceTest,
#category : #'Twilio-REST-Core-Tests-Base'
}

{ #category : #'accessing - defaults' }
TwilioRecordsTest >> defaultTestClass [
^ TwilioRecords
]

{ #category : #tests }
TwilioRecordsTest >> testResourceUrl [

self assert: (instance resourceUrl asString beginsWith: 'https://api.twilio.com/2010-04-01/Accounts').
self assert: (instance resourceUrl asString endsWith: 'Usage/Records.json')
]
20 changes: 20 additions & 0 deletions pharo-repository/Twilio-REST-Core-Tests/TwilioUsageTest.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"
A TwilioUsageTest is a test class for testing the behavior of TwilioUsage
"
Class {
#name : #TwilioUsageTest,
#superclass : #TwilioInstanceResourceTest,
#category : #'Twilio-REST-Core-Tests-Base'
}

{ #category : #'accessing - defaults' }
TwilioUsageTest >> defaultTestClass [
^ TwilioUsage
]

{ #category : #test }
TwilioUsageTest >> testResourceUrl [

self assert: (instance resourceUrl asString beginsWith: 'https://api.twilio.com/2010-04-01/Accounts').
self assert: (instance resourceUrl asString endsWith: 'Usage.json')
]
1 change: 1 addition & 0 deletions pharo-repository/Twilio-REST-Core-Tests/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Twilio-REST-Core-Tests' }

0 comments on commit c0b4d83

Please sign in to comment.