Skip to content

Commit 8f8ca1e

Browse files
authored
Merge pull request #101 from trocco-io/modernize-the-gha-pipeline
Improve/fix GitHub Actions pipleline
2 parents 8ddf58a + 035f167 commit 8f8ca1e

File tree

3 files changed

+99
-54
lines changed

3 files changed

+99
-54
lines changed

.github/workflows/check.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Check
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
types:
12+
- opened
13+
- synchronize
14+
15+
jobs:
16+
check:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up JDK 1.8
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: 8
24+
distribution: "zulu"
25+
- uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.gradle/caches
29+
~/.gradle/wrapper
30+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
31+
restore-keys: |
32+
${{ runner.os }}-gradle-
33+
- name: Lint
34+
run: ./gradlew spotlessCheck
35+
- name: Test
36+
run: ./gradlew test

.github/workflows/gem-push.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Ruby Gem
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Set up JDK 1.8
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: 8
17+
distribution: "zulu"
18+
- uses: actions/cache@v4
19+
with:
20+
path: |
21+
~/.gradle/caches
22+
~/.gradle/wrapper
23+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
24+
restore-keys: |
25+
${{ runner.os }}-gradle-
26+
- name: Lint
27+
run: ./gradlew spotlessCheck
28+
- name: Test
29+
run: ./gradlew test
30+
build:
31+
name: Build + Publish
32+
runs-on: ubuntu-latest
33+
needs:
34+
- test
35+
permissions:
36+
packages: write
37+
contents: read
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Set up Ruby 2.7
41+
uses: ruby/setup-ruby@v1
42+
with:
43+
ruby-version: 2.7
44+
- name: Set up JDK 1.8
45+
uses: actions/setup-java@v4
46+
with:
47+
java-version: 8
48+
distribution: "zulu"
49+
- uses: actions/cache@v4
50+
with:
51+
path: |
52+
~/.gradle/caches
53+
~/.gradle/wrapper
54+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
55+
restore-keys: |
56+
${{ runner.os }}-gradle-
57+
58+
- name: Push gem
59+
uses: trocco-io/push-gem-to-gpr-action@v2
60+
with:
61+
language: java
62+
gem-path: "./build/gems/*.gem"
63+
github-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/main.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)