Skip to content

Commit

Permalink
create GithubActions workflow for tests (#37)
Browse files Browse the repository at this point in the history
* create GithubActions workflow for normal tests

* create autolinter workflow for Github Actions (#38)

* Delete .travis.yml

* Create necessary files, classes and methods for SWALint

* update .smalltalk.ston to exclude linter class

* update baseline to load SWALint as requirement

* make some methods backwards compatible to 5.1/2

* increased linting timeout

* adapted linter tests to our needs

* excluded MEXResources for linting

* implemented logging of linter results

* updated README.md and added badge for coverage

* refactored according to Linter Rules
  • Loading branch information
Zyranix committed Jun 21, 2021
1 parent 405c9e3 commit 543e355
Show file tree
Hide file tree
Showing 195 changed files with 983 additions and 163 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request events on every branch
on: [push, pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
matrix:
# Select platform(s)
os: [ubuntu-latest, macos-latest, windows-latest]
# Select compatible Smalltalk image(s)
smalltalk: [Squeak64-trunk, Squeak64-5.3, Squeak64-5.2, Squeak64-5.1]
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: ${{ matrix.smalltalk }}
- name: Test MorphicAPIExplorer
run: smalltalkci -s ${{ matrix.smalltalk }}
shell: bash
timeout-minutes: 15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Linter

# Controls when the action will run. Triggers the workflow on push or pull request events on every branch
on: [push, pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
name: Squeak64-5.3 on ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Setup smalltalkCI
uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: Squeak64-5.3
- name: Test MorphicAPIExplorer
run: smalltalkci -s Squeak64-5.3 .linter.ston
shell: bash
timeout-minutes: 15
14 changes: 14 additions & 0 deletions .linter.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SmalltalkCISpec {
#preLoading : 'scripts/preLoading.st',
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'MorphicAPIExplorer',
#directory : 'packages',
#load : 'tests',
#platforms : [ #squeak ]
}
],
#testing : {
#classes : [ #MEXLinter ]
}
}
13 changes: 11 additions & 2 deletions .smalltalk.ston
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
SmalltalkCISpec {
#preLoading : 'scripts/preLoading.st',
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'MorphicAPIExplorer',
#platforms : [ #squeak ],
#directory : 'packages',
#load : [ 'tests' ]
#load : 'tests'
}
]
],
#testing : {
#exclude : {
#classes : [ #MEXLinter ]
},
#coverage : {
#packages : [ 'MorphicAPIExplorer-Core.*' ]
}
}
}
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MorphicAPIExplorer [![Build Status](https://travis-ci.org/hpi-swa-teaching/MorphicAPIExplorer.svg?branch=master)](https://travis-ci.org/hpi-swa-teaching/MorphicAPIExplorer)
# MorphicAPIExplorer ![Build Status](https://github.com/hpi-swa-teaching/MorphicAPIExplorer/workflows/CI/badge.svg?branch=dev)[![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/MorphicAPIExplorer/badge.svg?branch=dev)](https://coveralls.io/github/hpi-swa-teaching/MorphicAPIExplorer?branch=dev)

## Usage
When you cloned the repository from GitHub or installed the SAR archive you can simply open up a Workspace and type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,39 @@ baseline: spec
for: #'common'
do: [
spec
"requirements for SwaLint"
project: 'RefactoringBrowser' with: [
spec
className: 'ConfigurationOfRefactoringBrowser';
versionString: #'stable';
loads: #('Core' );
repository: 'http://www.squeaksource.com/MetacelloRepository' ];
"SwaLint setup"
package: 'SwaLint-Preferences' with: [
spec
file: 'SwaLint-Preferences-cypress.1';
repository: 'github://hpi-swa-teaching/SwaLint:main/packages'];
package: 'SwaLint-Core' with: [
spec
file: 'SwaLint-Core-cypress.1';
repository: 'github://hpi-swa-teaching/SwaLint:main/packages';
requires: #('RefactoringBrowser' 'SwaLint-Preferences')];
package: 'SwaLint-PlugIns' with: [
spec
file: 'SwaLint-PlugIns-cypress.1';
repository: 'github://hpi-swa-teaching/SwaLint:main/packages';
requires: 'SwaLint-Core'];

postLoadDoIt: #postLoad;

"MorphicAPIExplorer setup"
package: 'MorphicAPIExplorer-Core';
package: 'MorphicAPIExplorer-Tests' with: [spec requires: #('MorphicAPIExplorer-Core')];
package: 'MorphicAPIExplorer-Tests' with: [
spec
requires: #('MorphicAPIExplorer-Core' 'SwaLint-Core' 'SwaLint-PlugIns')];
yourself.

spec
group: 'default' with: #('MorphicAPIExplorer-Core');
group: 'tests' with: #('MorphicAPIExplorer-Tests')];
yourself
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
baseline
postLoad

(Smalltalk globals at: #SwaLint) perform: #install
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
"class" : {
},
"instance" : {
"baseline:" : "pre 4/10/2019 16:41" } }
"baseline:" : "pre 4/10/2019 16:41",
"postLoad" : " 6/14/2021 12:22:11" } }
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
accessing
icon

^ (self item isKindOf: MEXMethod)
^ (self item isKindOf: MEXMethod)
ifFalse: [nil]
ifTrue: [self item hasSubMethods
ifTrue: [nil]
ifFalse: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"contents" : "TB 6/21/2021 17:42",
"getDependencies" : "TB 6/21/2021 17:47",
"hasContents" : "TB 6/21/2021 17:44",
"icon" : "SH 6/21/2021 13:37",
"icon" : "SC 6/21/2021 23:48",
"parent" : "FFN 5/20/2019 14:01",
"parent:" : "TB 6/21/2021 17:46",
"setItem:model:parent:" : "FFN 7/24/2019 15:17" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
creation
splitMethodOnParameters

^ self name findTokens: #:
^ self name findTokens: $:
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"instance" : {
"asParameterizedString" : "jb 7/24/2019 12:19",
"asString" : "jb 7/24/2019 14:22",
"category" : "PC 6/10/2021 11:39",
"category:" : "PC 6/10/2021 11:39",
"dependencies" : "SC 5/13/2021 10:42",
"dependencies:" : "SC 5/13/2021 11:46",
"hasDependencies" : "SC 5/13/2021 11:42",
Expand All @@ -16,8 +18,6 @@
"initialize" : "PM 5/19/2021 18:22",
"isActiveDependee" : "SC 6/2/2021 21:35",
"isActiveDependee:" : "SC 6/2/2021 21:34",
"category" : "PC 6/10/2021 11:39",
"category:" : "PC 6/10/2021 11:39",
"isSelected" : "FFN 5/20/2019 16:09",
"isSelected:" : "FFN 6/19/2019 16:22",
"name" : "FFN 6/5/2019 22:53",
Expand All @@ -26,7 +26,7 @@
"parameterOf:" : "jb 7/18/2019 18:21",
"parameters" : "lk 6/21/2019 18:18",
"parameters:" : "lk 6/21/2019 18:18",
"splitMethodOnParameters" : "jb 7/18/2019 17:46",
"splitMethodOnParameters" : "SC 6/14/2021 17:53",
"subItems" : "TB 6/1/2021 17:54",
"subMethods" : "FFN 5/20/2019 15:21",
"subMethods:" : "FFN 5/20/2019 16:06" } }

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unsupported - drag and drop
dropAccept: Symbol
dropAccept: aSymbol

MEXUnsupportedError new signal

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
"buildWith:" : "FFN 6/12/2019 15:46",
"dragItem" : "jb 7/24/2019 14:19",
"dragItem:" : "jb 7/16/2019 15:13",
"dragStarted" : "jb 7/24/2019 14:19",
"dragStarted:" : "jb 7/16/2019 15:13",
"dropAccept" : "jb 7/24/2019 14:19",
"dropAccept:" : "jb 7/16/2019 15:14",
"dropAccept:" : "SC 6/15/2021 23:01",
"dropItem" : "jb 7/24/2019 14:19",
"dropItem:" : "jb 7/16/2019 15:14",
"findRelated" : "SC 6/3/2021 22:36",
Expand All @@ -21,15 +19,11 @@
"getSelectedPath:" : "jb 7/16/2019 15:23",
"getSelectionList" : "FFN 6/12/2019 15:30",
"getSelectionList:" : "FFN 6/12/2019 15:32",
"hoverAction" : "SC 5/29/2021 14:16",
"hoverAction:" : "SC 5/29/2021 14:16",
"setSelected" : "jb 7/24/2019 14:19",
"setSelected:" : "jb 7/16/2019 15:24",
"setSelectedParent" : "jb 7/24/2019 14:20",
"setSelectedParent:" : "jb 7/16/2019 15:23",
"setSelectedPath" : "jb 7/24/2019 14:20",
"setSelectedPath:" : "jb 7/16/2019 15:23",
"setSelectionList" : "FFN 6/12/2019 15:30",
"setSelectionList:" : "jb 7/16/2019 15:06",
"unhoverAction" : "SC 5/29/2021 15:58",
"unhoverAction:" : "SC 5/29/2021 15:58" } }
"setSelectionList:" : "jb 7/16/2019 15:06" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
accessing
keepRatio
"contrary to coding standards we need a lazy init because of initialization order in the super classes"

^ keepRatio ifNil: [keepRatio := false]
^ keepRatio ifNil: [self keepRatio: false. keepRatio]
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"instance" : {
"desiredExtent" : "jb 7/19/2019 15:12",
"desiredExtent:" : "FFN 6/5/2019 15:37",
"extent:" : "jb 7/24/2019 13:34",
"extent:" : "PC 6/21/2021 19:54",
"image:" : "jb 7/18/2019 18:32",
"keepRatio" : "jb 7/19/2019 15:12",
"keepRatio" : "SC 6/21/2021 23:17",
"keepRatio:" : "jb 7/24/2019 13:35",
"originalForm" : "jb 7/19/2019 15:12",
"originalForm:" : "FFN 6/5/2019 15:41",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
accessing
defaultMorphs: anObject

defaultMorphs := anObject

defaultMorphs := anObject
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
accessing
defaultMorphs

^ defaultMorphs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
as yet unclassified
default morphs
standardMorphs

^ {CircleMorph new . TextMorph new . SketchMorph new . RectangleMorph new . Morph new}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
"buildWith:" : "jb 5/4/2019 13:27",
"changeViewTo:" : "FFN 6/5/2019 23:04",
"closeOpenedWindow" : "jb 5/10/2019 17:45",
"defaultMorphs" : "PC 6/17/2021 18:22",
"defaultMorphs:" : "PC 6/17/2021 18:24",
"standardMorphs" : "SC 6/16/2021 20:59" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
],
"commentStamp" : "lk 7/24/2019 18:20",
"instvars" : [
],
"defaultMorphs" ],
"name" : "MEXTool",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ buildBackToOverViewButtonWith: aBuilder
leftFraction: self class leftSpecsHorizontalDistribution x;
topFraction: self class backButtonFractionHeight x;
rightFraction: self class leftSpecsHorizontalDistribution y;
bottomFraction: self class backButtonFractionHeight y);
bottomFraction: self class backButtonFractionHeight y;
yourself);
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ buildCodeEditorWith: aBuilder
leftFraction: self class rightSpecsHorizontalDistribution x;
topFraction: self class bottomSpecsVerticalDistribution x;
rightFraction: self class rightSpecsHorizontalDistribution y;
bottomFraction: self class bottomSpecsVerticalDistribution y);
bottomFraction: self class bottomSpecsVerticalDistribution y;
yourself);
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ buildDefaultMorphBoxWith: aBuilder
leftFraction: self class leftSpecsHorizontalDistribution x;
topFraction: self class bottomSpecsVerticalDistribution x;
rightFraction: self class leftSpecsHorizontalDistribution y;
bottomFraction: self class bottomSpecsVerticalDistribution y);
bottomFraction: self class bottomSpecsVerticalDistribution y;
yourself);
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ buildMethodListWith: aBuilder
leftFraction: self class leftSpecsHorizontalDistribution x;
topFraction: self class backButtonFractionHeight y;
rightFraction: self class leftSpecsHorizontalDistribution y;
bottomFraction: self class saveButtonFractionHeight x);
bottomFraction: self class saveButtonFractionHeight x;
yourself);
yourself
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ buildMorphPlaygroundPanelWith: aBuilder
leftFraction: self class rightSpecsHorizontalDistribution x;
topFraction: self class topSpecsVerticalDistribution x;
rightFraction: self class rightSpecsHorizontalDistribution y;
bottomFraction: self class topSpecsVerticalDistribution y);
bottomFraction: self class topSpecsVerticalDistribution y;
yourself);
yourself
Loading

0 comments on commit 543e355

Please sign in to comment.