Skip to content

Commit a8d2d25

Browse files
committed
chore: Add github build and test action
1 parent 8b84ddf commit a8d2d25

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
java-version: [11, 17]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up JDK ${{ matrix.java-version }}
20+
uses: actions/setup-java@v3
21+
with:
22+
java-version: ${{ matrix.java-version }}
23+
distribution: 'temurin'
24+
cache: maven
25+
26+
- name: Build with Maven
27+
run: mvn -B package --file pom.xml
28+
29+
- name: Run tests with coverage
30+
run: mvn test jacoco:report
31+
32+
- name: Upload test results
33+
if: always()
34+
uses: actions/upload-artifact@v3
35+
with:
36+
name: test-results-java-${{ matrix.java-version }}
37+
path: target/surefire-reports/
38+
39+
- name: Upload coverage to Codecov
40+
uses: codecov/codecov-action@v3
41+
with:
42+
file: target/site/jacoco/jacoco.xml
43+
fail_ci_if_error: true
44+
token: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# File Compression
22

3+
[![Build and Test](https://github.com/ayonious/File-Compression/actions/workflows/build.yml/badge.svg)](https://github.com/ayonious/File-Compression/actions/workflows/build.yml)
34
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/ayonious/File-Compression/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/ayonious/File-Compression/tree/master)
45
[![codecov](https://codecov.io/gh/ayonious/File-Compression/branch/master/graph/badge.svg)](https://codecov.io/gh/ayonious/File-Compression)
56
[![GitHub stars](https://img.shields.io/github/stars/ayonious/File-Compression?style=social)](https://github.com/ayonious/File-Compression/stargazers)

0 commit comments

Comments
 (0)