Skip to content

Commit 72f7080

Browse files
author
Tue Ton
committed
set up GitHub build actions with gradle
1 parent 92fd1b5 commit 72f7080

File tree

4 files changed

+49
-79
lines changed

4 files changed

+49
-79
lines changed

.github/workflows/ci-build.yml

+47-24
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
name: Continous build - build and test on every push
1+
# This workflow will build the Gitblit project with Gradle
2+
3+
name: CI
24

35
on:
46
push:
@@ -7,21 +9,28 @@ on:
79
- gh-pages
810

911
jobs:
10-
build:
11-
name: Build and test
12-
runs-on: ${{ matrix.os }}
12+
build_linux:
13+
name: Build and test in Linux environment
14+
runs-on: ubuntu-latest
1315
strategy:
1416
matrix:
15-
os: [ubuntu-latest, windows-latest]
1617
java-version: [8, 11]
17-
18+
1819
steps:
1920
- name: Checkout
20-
uses: actions/checkout@v1
21+
uses: actions/checkout@v2
2122
with:
2223
submodules: true
2324

24-
- name: Setup Java ${{ matrix.java-version }}
25+
- name: Cache Gradle packages
26+
uses: actions/cache@v1
27+
with:
28+
path: ~/.gradle/caches
29+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
30+
restore-keys: |
31+
${{ runner.os }}-gradle-
32+
33+
- name: Set up Java ${{ matrix.java-version }}
2534
uses: actions/setup-java@v1
2635
with:
2736
java-version: ${{ matrix.java-version }}
@@ -31,34 +40,48 @@ jobs:
3140
java -version
3241
javac -version
3342
34-
- name: Build with Ant
35-
run: ant test
43+
- name: Grant execute permission for gradlew
44+
run: chmod +x gradlew
45+
46+
- name: Build all artefacts
47+
run: ./gradlew --no-daemon buildAll
48+
49+
- name: Run unit tests
50+
run: ./gradlew --no-daemon test
51+
52+
build_windows:
53+
name: Build and test in Windows environment
54+
runs-on: windows-latest
55+
strategy:
56+
matrix:
57+
java-version: [8, 11]
3658

37-
build_j7:
38-
name: Build and test on Java 7
39-
runs-on: ubuntu-latest
40-
4159
steps:
4260
- name: Checkout
43-
uses: actions/checkout@v1
61+
uses: actions/checkout@v2
4462
with:
4563
submodules: true
4664

47-
- name: Setup Java 7
65+
- name: Cache Gradle packages
66+
uses: actions/cache@v1
67+
with:
68+
path: ~\.gradle\caches
69+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
70+
restore-keys: |
71+
${{ runner.os }}-gradle-
72+
73+
- name: Set up Java ${{ matrix.java-version }}
4874
uses: actions/setup-java@v1
4975
with:
50-
java-version: 7
76+
java-version: ${{ matrix.java-version }}
5177

5278
- name: Report Java version
5379
run: |
5480
java -version
5581
javac -version
5682
57-
- name: Setup Moxie
58-
run: |
59-
wget http://gitblit.github.io/moxie/maven/com/gitblit/moxie/moxie+ant/0.9.4/moxie+ant-0.9.4.tar.gz
60-
tar -xzf moxie+ant-0.9.4.tar.gz
61-
moxie-0.9.4/bin/moxie -version
83+
- name: Build all artefacts
84+
run: gradlew.bat --no-daemon buildAll
6285

63-
- name: Build with Moxie
64-
run: moxie-0.9.4/bin/moxie test
86+
- name: Run unit tests
87+
run: gradlew.bat --no-daemon test

HOME.md

-55
This file was deleted.

README.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
A fork of [gitblit] to fix various test failures, and to improve the build infrastructure using Gradle as the build tool.
22

3+
[![GitHub Build Status](https://github.com/chirontt/gitblit/workflows/CI/badge.svg)](https://github.com/chirontt/gitblit/actions)
4+
35
## Gradle build
46

57
Standard Gradle tasks are used in the `build.gradle` script to compile and package Gitblit artefacts. Also, custom Gradle tasks were added to the standard `buildSrc` folder to achieve complex operations which are unique to the Gitblit project, and thus are unavailable in standard Gradle nor in any relevant plugins on the Internet.

gradlew

100644100755
File mode changed.

0 commit comments

Comments
 (0)