Skip to content

Commit

Permalink
Refactor setup-gradle tasks (#98)
Browse files Browse the repository at this point in the history
* Use gradle wrapper

* Fix

* Format
  • Loading branch information
rogervinas authored Jul 22, 2024
1 parent 4bf5158 commit 6044b33
Show file tree
Hide file tree
Showing 12 changed files with 140 additions and 144 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/bash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
working-directory: bash

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true

- name: Test
run: ./test/bats/bin/bats test/hello.bats
- name: Test
run: ./test/bats/bin/bats test/hello.bats

- name: Run
run: ./src/hello.bash
- name: Run
run: ./src/hello.bash
68 changes: 34 additions & 34 deletions .github/workflows/cobol.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Cobol

on:
push:
branches: ["main"]
branches: [ main ]
paths:
- .github/workflows/cobol.yml
- cobol/**
pull_request:
branches: ["main"]
branches: [ main ]
paths:
- .github/workflows/cobol.yml
- cobol/**
Expand All @@ -24,35 +24,35 @@ jobs:
working-directory: cobol

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Java
uses: actions/setup-java@v4
with:
java-version: "8"
distribution: "temurin"

- name: Configure Cobol
run: |
sudo apt-get install -y gnucobol
cobc --version
- name: Test
run: ./cobolcheck -p HELLO

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: test
path: cobol/output/testResults.xml
reporter: jest-junit

- name: Build
run: |
cobc src/main/cobol/HELLO-CONSOLE.CBL
cobc -x src/main/cobol/HELLO.CBL
- name: Run
run: ./HELLO
- name: Checkout
uses: actions/checkout@v4

- name: Configure Java
uses: actions/setup-java@v4
with:
java-version: "8"
distribution: "temurin"

- name: Configure Cobol
run: |
sudo apt-get install -y gnucobol
cobc --version
- name: Test
run: ./cobolcheck -p HELLO

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: test
path: cobol/output/testResults.xml
reporter: jest-junit

- name: Build
run: |
cobc src/main/cobol/HELLO-CONSOLE.CBL
cobc -x src/main/cobol/HELLO.CBL
- name: Run
run: ./HELLO
18 changes: 9 additions & 9 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
working-directory: dotnet

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Configure .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0
cache: false
- name: Configure .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0
cache: false

- name: Test
run: dotnet test -v quiet -l:"console;verbosity=normal"
- name: Test
run: dotnet test -v quiet -l:"console;verbosity=normal"
18 changes: 9 additions & 9 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
working-directory: go

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Configure Go
uses: actions/setup-go@v5
with:
go-version-file: 'go/go.mod'
cache: false
- name: Configure Go
uses: actions/setup-go@v5
with:
go-version-file: 'go/go.mod'
cache: false

- name: Test
run: go test -test.v
- name: Test
run: go test -test.v
24 changes: 11 additions & 13 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: gradle

- name: Build
uses: gradle/actions/setup-gradle@v3
with:
arguments: build
build-root-directory: java
- name: Build
working-directory: java
run: ./gradlew build
24 changes: 12 additions & 12 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ jobs:
working-directory: javascript

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Configure Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- name: Configure Node
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: javascript/package-lock.json

- name: Install
run: npm install
- name: Install
run: npm install

- name: Test
run: npm test
- name: Test
run: npm test
24 changes: 11 additions & 13 deletions .github/workflows/kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: gradle

- name: Build
uses: gradle/actions/setup-gradle@v3
with:
arguments: build
build-root-directory: kotlin
- name: Build
working-directory: kotlin
run: ./gradlew build
16 changes: 8 additions & 8 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
working-directory: python

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Configure Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Test
run: python -m unittest discover -v
- name: Test
run: python -m unittest discover -v
24 changes: 12 additions & 12 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ jobs:
working-directory: ruby

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Ruby
uses: ruby/setup-ruby@161cd54b698f1fb3ea539faab2e036d409550e3c
with:
ruby-version: '3'
bundler-cache: true
working-directory: ruby

- name: Test
run: bundle exec rspec -fd
- name: Checkout
uses: actions/checkout@v4

- name: Configure Ruby
uses: ruby/setup-ruby@161cd54b698f1fb3ea539faab2e036d409550e3c
with:
ruby-version: '3'
bundler-cache: true
working-directory: ruby

- name: Test
run: bundle exec rspec -fd
12 changes: 6 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
working-directory: rust

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Test
run: cargo test
- name: Test
run: cargo test

- name: Build
run: cargo build
- name: Build
run: cargo build
36 changes: 18 additions & 18 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ jobs:
working-directory: scala

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: sbt

- name: Test
run: sbt test

# Optional: This step uploads information to the GitHub dependency graph and unblocking Dependabot alerts for the repository
- name: Upload Dependency Graph
uses: scalacenter/sbt-dependency-submission@7ebd561e5280336d3d5b445a59013810ff79325e
with:
working-directory: scala
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: sbt

- name: Test
run: sbt test

# Optional: This step uploads information to the GitHub dependency graph and unblocking Dependabot alerts for the repository
- name: Upload Dependency Graph
uses: scalacenter/sbt-dependency-submission@7ebd561e5280336d3d5b445a59013810ff79325e
with:
working-directory: scala
4 changes: 2 additions & 2 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: Swift

on:
push:
branches: ["main"]
branches: [ main ]
paths:
- .github/workflows/swift.yml
- swift/**
pull_request:
branches: ["main"]
branches: [ main ]
paths:
- .github/workflows/swift.yml
- swift/**
Expand Down

0 comments on commit 6044b33

Please sign in to comment.