Skip to content

Merge pull request #6 from kudashevs/main #44

Merge pull request #6 from kudashevs/main

Merge pull request #6 from kudashevs/main #44

Workflow file for this run

name: run tests on projects
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
jobs:
cache-gradle:
runs-on: ubuntu-latest
steps:
- name: get code
uses: actions/checkout@v3
- name: cache dependencies (Gradle)
id: cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: tickle Gradle
if: steps.cache.outputs.cache-hit != 'true'
working-directory: java
run: ./gradlew --version
- 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
steps:
- name: get code
uses: actions/checkout@v3
- name: cache dependencies (Gradle)
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: run unit tests
working-directory: groovy
run: ./gradlew test
test-java:
needs: cache-gradle
runs-on: ubuntu-latest
steps:
- name: get code
uses: actions/checkout@v3
- name: cache dependencies (Gradle)
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: run unit tests
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
runs-on: ubuntu-latest
steps:
- name: get code
uses: actions/checkout@v3
- name: cache dependencies (Gradle)
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: run unit tests
working-directory: kotlin
run: ./gradlew test
test-php:
runs-on: ubuntu-latest
steps:
- name: get code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: curl, libxml, mbstring
coverage: none
- name: Install dependencies
working-directory: php
run: composer update --prefer-stable --prefer-dist --no-interaction
- name: Execute tests
working-directory: php
run: composer test
test-python:
runs-on: ubuntu-latest
steps:
- name: get code
uses: actions/checkout@v3
- name: run unit tests
working-directory: python
run: python test_gol.py
test-ruby:
runs-on: ubuntu-latest
steps:
- name: get code
uses: actions/checkout@v3
- name: run unit tests
working-directory: ruby
run: rake test
test-scala:
needs: cache-gradle
runs-on: ubuntu-latest
steps:
- name: get code
uses: actions/checkout@v3
- name: cache dependencies (Gradle)
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: run unit tests
working-directory: scala
run: ./gradlew test
# not working due to ancient project layout (not supported)
#
# test-swift:
# runs-on: ubuntu-latest
#
# steps:
# - name: get code
# uses: actions/checkout@v3
#
# - 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