Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a modern PHP version and some improvements #6

Merged
merged 19 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[{*.js,*.ts,*.tsx}]
indent_size = 2

[{*.json,*.yml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
237 changes: 136 additions & 101 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

name: run tests on projects

on:
workflow_dispatch:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

permissions:
contents: read
Expand All @@ -32,13 +31,88 @@ jobs:

- name: tickle Gradle
if: steps.cache.outputs.cache-hit != 'true'
working-directory: java
run: ./gradlew --version
working-directory: java

- name: TRACER cache hit
if: steps.cache.outputs.cache-hit == 'true'
run: echo "TRACER cache hit OK"

test-c:
runs-on: ubuntu-latest

steps:
- name: get code
uses: actions/checkout@v3

- name: run unit tests
working-directory: c
run: ./run_tests.sh

test-clojure:
runs-on: ubuntu-latest

steps:
- name: get code
uses: actions/checkout@v3

- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
# Install just one or all simultaneously
# The value must indicate a particular version of the tool, or use 'latest'
# to always provision the latest version
cli: 1.10.1.693 # Clojure CLI based on tools.deps
lein: 2.9.1 # Leiningen

- name: run unit tests
working-directory: clojure
run: lein test

# not working: project is based on ancient Mono and not Dotnet Core (!!)
#
# test-csharp:
# runs-on: ubuntu-latest
#
# steps:
# - name: get code
# uses: actions/checkout@v3
#
# - name: install NUnit
# run: |
# nuget install NUnit.Runners -o ./nunit -version 2.6.4
# mkdir /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/nunit-console.exe /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/nunit-console.exe.config /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/nunit.framework.dll /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/lib/nunit-console-runner.dll /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/lib/nunit.util.dll /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/lib/nunit.core.interfaces.dll /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/lib/nunit.core.dll /nunit
# working-directory: csharp
#
# - name: run unit tests
# run: ./run_tests.sh
# working-directory: csharp

test-golang:
runs-on: ubuntu-latest

steps:
- name: get code
uses: actions/checkout@v3

- name: get Go
uses: actions/setup-go@v3

- name: init module
working-directory: golang
run: go mod init golang

- name: run unit tests
working-directory: golang/src/life
run: go test

test-groovy:
needs: cache-gradle
runs-on: ubuntu-latest
Expand All @@ -64,8 +138,8 @@ jobs:
distribution: 'adopt'

- name: run unit tests
run: ./gradlew test
working-directory: groovy
run: ./gradlew test

test-java:
needs: cache-gradle
Expand All @@ -92,8 +166,23 @@ jobs:
distribution: 'adopt'

- name: run unit tests
run: ./gradlew test
working-directory: java
run: ./gradlew test

# test-javascript:
# runs-on: ubuntu-latest
#
# steps:
# - name: get code
# uses: actions/checkout@v3
#
# - name: install
# run: npm install
# working-directory: javascript
#
# - name: test
# run: npm run test-single-run
# working-directory: javascript

test-kotlin:
needs: cache-gradle
Expand All @@ -120,79 +209,52 @@ jobs:
distribution: 'adopt'

- name: run unit tests
run: ./gradlew test
working-directory: kotlin
run: ./gradlew test

test-python:
runs-on: ubuntu-latest

steps:
- name: get code
uses: actions/checkout@v3

- name: run unit tests
run: python test_gol.py
working-directory: python

test-ruby:
test-php:
runs-on: ubuntu-latest

steps:
- name: get code
uses: actions/checkout@v3

- name: run unit tests
run: rake test
working-directory: ruby

test-c:
runs-on: ubuntu-latest
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: curl, libxml, mbstring
coverage: none

steps:
- name: get code
uses: actions/checkout@v3
- name: Install dependencies
working-directory: php
run: composer update --prefer-stable --prefer-dist --no-interaction

- name: run unit tests
run: ./run_tests.sh
working-directory: c
- name: Execute tests
working-directory: php
run: composer test

test-golang:
test-python:
runs-on: ubuntu-latest

steps:
- name: get code
uses: actions/checkout@v3

- name: get Go
uses: actions/setup-go@v3

- name: init module
run: go mod init golang
working-directory: golang

- name: run unit tests
run: go test
working-directory: golang/src/life
working-directory: python
run: python test_gol.py

test-clojure:
test-ruby:
runs-on: ubuntu-latest

steps:
- name: get code
uses: actions/checkout@v3

- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
# Install just one or all simultaneously
# The value must indicate a particular version of the tool, or use 'latest'
# to always provision the latest version
cli: 1.10.1.693 # Clojure CLI based on tools.deps
lein: 2.9.1 # Leiningen

- name: run unit tests
run: lein test
working-directory: clojure
working-directory: ruby
run: rake test

test-scala:
needs: cache-gradle
Expand All @@ -219,55 +281,8 @@ jobs:
distribution: 'adopt'

- name: run unit tests
run: ./gradlew test
working-directory: scala

# --------------------------------------

# not working: project is based on ancient Mono and not Dotnet Core (!!)
#
# test-csharp:
# runs-on: ubuntu-latest
#
# steps:
# - name: get code
# uses: actions/checkout@v3
#
# - name: install NUnit
# run: |
# nuget install NUnit.Runners -o ./nunit -version 2.6.4
# mkdir /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/nunit-console.exe /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/nunit-console.exe.config /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/nunit.framework.dll /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/lib/nunit-console-runner.dll /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/lib/nunit.util.dll /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/lib/nunit.core.interfaces.dll /nunit
# cp /tmp/nunit/NUnit.Runners.2.6.4/tools/lib/nunit.core.dll /nunit
# working-directory: csharp
#
# - name: run unit tests
# run: ./run_tests.sh
# working-directory: csharp

# not working: ancient package.json needs to be rebuilt
#
# test-javascript:
# runs-on: ubuntu-latest
#
# steps:
# - name: get code
# uses: actions/checkout@v3
#
# - name: install
# run: npm install
# working-directory: javascript
#
# - name: test
# run: npm run test-single-run
# working-directory: javascript


run: ./gradlew test

# not working due to ancient project layout (not supported)
#
Expand All @@ -281,3 +296,23 @@ jobs:
# - name: run unit tests
# run: ./test.sh
# working-directory: swift

test-typescript:
runs-on: ubuntu-latest

steps:
- name: get code
uses: actions/checkout@v3

- name: Set up Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: '18.x'

- name: Install dependencies
working-directory: typescript
run: npm install

- name: Execute tests
working-directory: typescript
run: npm test
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

## GDCR-Scaffolding
Starter projects in various languages for [Global Day of Coderetreat](http://globalday.coderetreat.org/)
Starter projects in various languages for the [Global Day of Coderetreat](https://www.coderetreat.org/).

### Motivation

Expand All @@ -13,7 +13,7 @@ Starter projects in various languages for [Global Day of Coderetreat](http://glo

### Github Actions

* Some of the starter projects are validated via Github Actions. see [this file](./.github/workflows/ci.yml)
* Some of the starter projects are validated via Github Actions (see [this file](./.github/workflows/ci.yml)).

### About Us

Expand Down
2 changes: 1 addition & 1 deletion break.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def addShellPrefix = { command ->
def runCommand = { command, workingDir ->
def process = new ProcessBuilder(addShellPrefix(command))
.directory(workingDir)
.redirectErrorStream(true)
.redirectErrorStream(true)
.start()
process.inputStream.eachLine {println it}
process.waitFor()
Expand Down
3 changes: 1 addition & 2 deletions break.settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// These projects are tested by Travis CI.
//
// TODO: figure out the problem with Ruby (probably a requirement
// within Rake)
// TODO: figure out the problem with Ruby (probably a requirement within Rake)
include 'groovy','java','javascript','kotlin','python','scala'
Loading
Loading