Skip to content

Commit 770ce8d

Browse files
committed
chore: Migrate build and test to GitHub actions
1 parent 6ea26c8 commit 770ce8d

File tree

3 files changed

+105
-143
lines changed

3 files changed

+105
-143
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Build and test
2+
on: [push]
3+
4+
jobs:
5+
build-and-check:
6+
name: Build and check
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-java@v4
11+
with:
12+
java-version: '17'
13+
distribution: 'temurin'
14+
15+
- name: Setup Gradle
16+
uses: gradle/actions/setup-gradle@v4
17+
with:
18+
cache-read-only: false
19+
20+
- name: Generate and submit dependency graph
21+
uses: gradle/actions/dependency-submission@v4
22+
if: ${{ github.ref == 'refs/heads/master' }}
23+
24+
- name: Build, check and test
25+
run: ./gradlew shadowJar annotation:jar check integrationTest
26+
27+
- name: Upload artifact
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: Jars
31+
path: |
32+
agent/build/libs/*.jar
33+
annotation/build/libs/*.jar
34+
35+
test-suite:
36+
strategy:
37+
matrix:
38+
java: ['17', '11', '8']
39+
runs-on: ubuntu-latest
40+
name: Run test suite with Java ${{ matrix.java }}
41+
needs: build-and-check
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: actions/setup-java@v4
46+
name: Set up Java
47+
with:
48+
java-version: ${{ matrix.java }}
49+
distribution: 'temurin'
50+
51+
- name: Setup Bats and bats libs
52+
id: setup-bats
53+
uses: bats-core/[email protected]
54+
55+
- uses: sbt/setup-sbt@v1
56+
57+
- name: Download artifact
58+
uses: actions/download-artifact@v4
59+
with:
60+
name: Jars
61+
62+
- name: Clone test projects
63+
shell: bash
64+
env:
65+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
66+
TERM: xterm
67+
working-directory: ./agent
68+
run: bin/test_projects
69+
70+
- uses: actions/setup-java@v4
71+
name: Set up Gradle cache
72+
with:
73+
java-version: ${{ matrix.java }}
74+
distribution: 'temurin'
75+
cache: gradle
76+
77+
- uses: actions/setup-java@v4
78+
name: Set up Maven cache
79+
with:
80+
java-version: ${{ matrix.java }}
81+
distribution: 'temurin'
82+
cache: maven
83+
84+
- uses: actions/setup-java@v4
85+
name: Set up sbt cache
86+
with:
87+
java-version: ${{ matrix.java }}
88+
distribution: 'temurin'
89+
cache: sbt
90+
91+
- name: Build test projects
92+
shell: bash
93+
env:
94+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
95+
TERM: xterm
96+
working-directory: ./agent
97+
run: bin/test_install
98+
99+
- name: Run tests
100+
shell: bash
101+
env:
102+
BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }}
103+
TERM: xterm
104+
working-directory: ./agent
105+
run: bin/test_run

.github/workflows/build.yml

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

.travis.yml

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

0 commit comments

Comments
 (0)