Skip to content

Commit

Permalink
Merge pull request #48 from ba-st/pharo11
Browse files Browse the repository at this point in the history
Add Pharo 11 support
  • Loading branch information
gcotelli authored May 23, 2023
2 parents 321fb78 + 4884946 commit 9c57522
Show file tree
Hide file tree
Showing 25 changed files with 201 additions and 38 deletions.
3 changes: 1 addition & 2 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/ba-st/pharo-loader:v10.0.1 as loader
FROM ghcr.io/ba-st/pharo-loader:v11.0.0 as loader

COPY --chown=pharo:users ./source ./source
COPY --chown=pharo:users ./.git/ ./.git/
Expand All @@ -8,6 +8,5 @@ RUN pharo metacello install gitlocal://./source \
FROM launchpad:sut

COPY --from=loader /opt/pharo/Pharo.image ./
COPY --from=loader /opt/pharo/Pharo.changes ./
COPY --from=loader /opt/pharo/Pharo*.sources ./
CMD [ "launchpad-start", "greeter" , "--name=DJ", "--title=Mr." ]
7 changes: 5 additions & 2 deletions .docker/docker-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ function assertOutputIncludesMessage() {
set -e

print_info "Building base image"
docker build -t launchpad:sut docker
docker buildx build --tag launchpad:sut docker

print_info "Building examples image"
docker build -t launchpad-examples:sut -f .docker/Dockerfile .
docker buildx build \
--tag launchpad-examples:sut \
--file .docker/Dockerfile \
.

print_info "Running basic test"
executeWithArguments docker run launchpad-examples:sut
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/.binary-stack-serialization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Binary Stack Serialization Tests

on: [push,pull_request,workflow_dispatch]

jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
smalltalk: [ Pharo64-11, Pharo64-10, Pharo64-9.0, Pharo64-8.0 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v3
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
- name: Load Image and Run Tests
# We can't run these tests with the coverage enabled because it will modify the stack it's
# trying to serialize making the tests fail in some situations
run: smalltalkci -s ${{ matrix.smalltalk }} .smalltalkci/.binary-stack-serialization.ston
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 15
8 changes: 4 additions & 4 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ jobs:
uses: actions/checkout@v3
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: crazy-max/ghaction-docker-meta@v4
with:
images: ghcr.io/${{ github.repository_owner }}/launchpad
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
- name: Login to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: Docker build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: ./docker
push: ${{ github.event_name != 'pull_request' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/loading-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
strategy:
fail-fast: false
matrix:
smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0 ]
smalltalk: [ Pharo64-11, Pharo64-10, Pharo64-9.0, Pharo64-8.0 ]
load-spec: [ deployment, examples, tools, sunit, development]
name: ${{ matrix.smalltalk }} + ${{ matrix.load-spec }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ jobs:
name: runner / markdownlint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: markdownlint
uses: reviewdog/action-markdownlint@v0.1
uses: reviewdog/action-markdownlint@v0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run Shellcheck
uses: reviewdog/action-shellcheck@v1
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0 ]
smalltalk: [ Pharo64-11, Pharo64-10, Pharo64-9.0, Pharo64-8.0 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-image: ${{ matrix.smalltalk }}
Expand Down
20 changes: 20 additions & 0 deletions .smalltalkci/.binary-stack-serialization.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'Launchpad',
#directory : '../source',
#load : [ 'CI' ],
#platforms : [ #pharo ]
}
],
#testing : {
#exclude : {
#packages : [
'Launchpad-Applications*',
'Launchpad-Commands*',
'Launchpad-Configuration*',
'Launchpad-Examples*',
'Launchpad-SUnit*' ]
}
}
}
10 changes: 9 additions & 1 deletion .smalltalkci/.unit-tests.ston
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@ SmalltalkCISpec {
}
],
#testing : {
#exclude : {
#packages : [ 'Launchpad-Tracing*']
},
#coverage : {
#packages : [ 'Launchpad*' ],
#packages : [
'Launchpad-Applications*',
'Launchpad-Commands*',
'Launchpad-Configuration*',
'Launchpad-Examples*',
'Launchpad-SUnit*' ],
#format: #lcov
}
}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2022 Buenos Aires Smalltalk Contributors
Copyright (c) 2018-2023 Buenos Aires Smalltalk Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ within the image.
[![Pharo 8.0](https://img.shields.io/badge/Pharo-8.0-informational)](https://pharo.org)
[![Pharo 9.0](https://img.shields.io/badge/Pharo-9.0-informational)](https://pharo.org)
[![Pharo 10](https://img.shields.io/badge/Pharo-10-informational)](https://pharo.org)
[![Pharo 11](https://img.shields.io/badge/Pharo-11-informational)](https://pharo.org)

## Quick links

Expand All @@ -37,7 +38,7 @@ Launchpad provides abstractions to architect your application:

## Installation

To load the project in a Pharo image follow this [instructions](docs/how-to/how-to-load-in-pharo.md).
To load the project in a Pharo image follow these [instructions](docs/how-to/how-to-load-in-pharo.md).

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/ba-st/pharo:v10.0.1
FROM ghcr.io/ba-st/pharo:v11.0.0

COPY --chown=pharo:users ./launchpad* ./
USER root
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/how-to-load-in-pharo.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
*Metacello -> Install baseline of Launchpad ...*
9. Type `Development` and click *Ok*
> After Iceberg cloned a repository, it will be checked-out at the default
> After Iceberg cloned a repository, it will be checked-out at the default
> branch (in this case `release-candidate`). If you want to work on a different
> branch or commit perform the checkout before the baseline installation step.
7 changes: 3 additions & 4 deletions docs/reference/Docker.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Docker support

Launchpad provides a Docker image that can be used as base for containerized
applications. It's built on top of [pharo:v10.0.1](https://github.com/ba-st/docker-pharo-runtime),
applications. It's built on top of [pharo:v11.0.0](https://github.com/ba-st/docker-pharo-runtime),
adding some useful scripts for Launchpad-based applications:

- `launchpad` starts the CLI
- `launchpad-explain` starts the CLI with the `explain` command
- `launchpad-list` starts the CLI with the `list` command
- `launchpad-start` starts the CLI with the `start` command and setup
- `launchpad-start` starts the CLI with the `start` command and set up
a `SIGTERM` handler for gracefully stopping the application.
- `launchpad-healthcheck` is run as the default docker `HEALTHCHECK`

Expand All @@ -16,13 +16,12 @@ adding some useful scripts for Launchpad-based applications:
In your Dockerfile put something like:

```docker
FROM ghcr.io/ba-st/pharo-loader:v10.0.1 AS loader
FROM ghcr.io/ba-st/pharo-loader:v11.0.0 AS loader
# Load your own application
RUN pharo metacello install github://owner/repo:branch BaselineOfProject
FROM ghcr.io/ba-st/launchpad:v4
COPY --from=loader /opt/pharo/Pharo.image ./
COPY --from=loader /opt/pharo/Pharo.changes ./
COPY --from=loader /opt/pharo/Pharo*.sources ./
# Your own directives
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/Logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ to process these events. One of the loggers writes informational log records to
Applications can freely configure their loggers if they want to report these events
differently.

If you want the logging in an structured format, use `--enable-structured-logging`
If you want the logging in a structured format, use `--enable-structured-logging`
option. When enabled the logs are emitted in JSON format.
57 changes: 49 additions & 8 deletions source/BaselineOfLaunchpad/BaselineOfLaunchpad.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Class {
#category : #BaselineOfLaunchpad
}

{ #category : #baselines }
{ #category : #'post-load actions' }
BaselineOfLaunchpad >> addLaunchpadLogRecordAsGlobal [

Smalltalk at: #LaunchpadLogRecord put: LogRecord
Expand All @@ -14,7 +14,7 @@ BaselineOfLaunchpad >> addLaunchpadLogRecordAsGlobal [
BaselineOfLaunchpad >> baseline: spec [

<baseline>
spec for: #pharo do: [
spec for: #pharo do: [
spec postLoadDoIt: #addLaunchpadLogRecordAsGlobal.
self
setUpDependencies: spec;
Expand All @@ -25,8 +25,23 @@ BaselineOfLaunchpad >> baseline: spec [
group: 'CI' with: 'Tests';
group: 'default' with: 'Development' ].

spec for: #'pharo10.x' do: [ self setUpPharo10Packages: spec ].
spec for: #'pharo8.x' do: [ self setUpPharo8Packages: spec ].
spec for: #'pharo9.x' do: [ self setUpPharo9Packages: spec ].
spec for: #'pharo10.x' do: [ self setUpPharo10Packages: spec ].
spec for: #'pharo11.x' do: [
self setUpPharo11Packages: spec.
spec preLoadDoIt: #closeWelcomeWindow ]
]

{ #category : #'post-load actions' }
BaselineOfLaunchpad >> closeWelcomeWindow [
"Workaround for https://github.com/pharo-project/pharo/issues/13788"

Smalltalk globals
at: #StWelcomeBrowser
ifPresent: [ :class |
class allInstancesDo: [ :browser | browser owner close ] ].
Smalltalk garbageCollect
]

{ #category : #accessing }
Expand Down Expand Up @@ -106,21 +121,47 @@ BaselineOfLaunchpad >> setUpPackages: spec [
BaselineOfLaunchpad >> setUpPharo10Packages: spec [

spec
package: 'Launchpad-Development-Tools' with: [
spec requires:
#( 'Launchpad-Applications' 'Launchpad-Configuration' ) ];
package: 'Launchpad-Tracing-Fuel-Legacy' with: [ spec requires: 'Launchpad-Tracing' ];
group: 'Deployment' with: 'Launchpad-Tracing-Fuel-Legacy';
group: 'Tests' with: 'Launchpad-Tracing-Fuel-Legacy'.

spec
package: 'Launchpad-Development-Tools'
with: [ spec requires: #( 'Launchpad-Applications' 'Launchpad-Configuration' ) ];
group: 'Tools' with: 'Launchpad-Development-Tools'
]

{ #category : #baselines }
BaselineOfLaunchpad >> setUpPharo11Packages: spec [

spec
package: 'Launchpad-Tracing-Fuel' with: [ spec requires: 'Launchpad-Tracing' ];
group: 'Deployment' with: 'Launchpad-Tracing-Fuel';
group: 'Tests' with: 'Launchpad-Tracing-Fuel'
]

{ #category : #baselines }
BaselineOfLaunchpad >> setUpPharo8Packages: spec [

spec
package: 'Launchpad-Tracing-Pharo8'
with: [ spec requires: 'Launchpad-Tracing' ];
package: 'Launchpad-Tracing-Fuel-Legacy' with: [ spec requires: 'Launchpad-Tracing' ];
group: 'Deployment' with: 'Launchpad-Tracing-Fuel-Legacy';
group: 'Tests' with: 'Launchpad-Tracing-Fuel-Legacy'.

spec
package: 'Launchpad-Tracing-Pharo8' with: [ spec requires: 'Launchpad-Tracing-Fuel-Legacy' ];
group: 'Deployment' with: 'Launchpad-Tracing-Pharo8'
]

{ #category : #baselines }
BaselineOfLaunchpad >> setUpPharo9Packages: spec [

spec
package: 'Launchpad-Tracing-Fuel-Legacy' with: [ spec requires: 'Launchpad-Tracing' ];
group: 'Deployment' with: 'Launchpad-Tracing-Fuel-Legacy';
group: 'Tests' with: 'Launchpad-Tracing-Fuel-Legacy'
]

{ #category : #baselines }
BaselineOfLaunchpad >> setUpSUnitPackages: spec [

Expand Down
1 change: 1 addition & 0 deletions source/Launchpad-SUnit/LaunchpadTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ LaunchpadTest >> tearDown [

loggingAsserter stopLoggers.
runningApplication ifNotNil: #stop.
LaunchpadApplication resetCurrentlyRunning.
super tearDown
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ Class {
#instVars : [
'openStreamAction'
],
#category : #'Launchpad-Tracing'
#category : #'Launchpad-Tracing-Fuel-Legacy'
}

{ #category : #coverage }
{ #category : #accessing }
StackTraceBinarySerializer class >> classNamesNotUnderTest [

^ #( StackTraceBinarySerializer )
Expand Down
1 change: 1 addition & 0 deletions source/Launchpad-Tracing-Fuel-Legacy/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Launchpad-Tracing-Fuel-Legacy' }
Loading

0 comments on commit 9c57522

Please sign in to comment.