Skip to content

Commit 0d07d12

Browse files
authored
chore: Migrate from CircleCI to GitHub Actions (#94)
1 parent 1dcbb44 commit 0d07d12

File tree

4 files changed

+94
-131
lines changed

4 files changed

+94
-131
lines changed

.circleci/config.yml

-129
This file was deleted.

.github/workflows/ci.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Quality control checks
2+
3+
on:
4+
push:
5+
branches: [ main, 'feat/**' ]
6+
paths-ignore:
7+
- '**.md' # Do not need to run CI for markdown changes.
8+
pull_request:
9+
branches: [ main, 'feat/**' ]
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
linux:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
java-version: ["8", "11", "17"]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-java@v4
25+
with:
26+
distribution: 'temurin' # See 'Supported distributions' for available options
27+
java-version: ${{ matrix.java-version }}
28+
29+
- run: ./gradlew dependencies
30+
- run: ./gradlew jar
31+
- run: ./gradlew checkstyleMain
32+
33+
- run: make test
34+
35+
- name: Generate test coverage report
36+
run: |
37+
./gradlew jacocoTestReport
38+
mkdir -p coverage/
39+
cp -r build/reports/jacoco/test/* ./coverage
40+
- name: Enforce test coverage
41+
run: ./gradlew jacocoTestCoverageVerification
42+
43+
- name: Save test results
44+
run: |
45+
mkdir -p ~/junit/;
46+
find . -type f -regex ".*/build/test-results/.*xml" -exec cp {} ~/junit/ \;
47+
48+
- uses: actions/upload-artifact@v4
49+
with:
50+
name: ${{ matrix.java-version }} junit results
51+
path: ~/junit
52+
53+
- uses: actions/upload-artifact@v4
54+
with:
55+
name: ${{ matrix.java-version }} code coverage
56+
path: ./coverage
57+
58+
- name: run contract tests
59+
run: make contract-tests
60+
61+
windows:
62+
runs-on: windows-latest
63+
64+
defaults:
65+
run:
66+
shell: powershell
67+
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
java-version: ["11.0.2.01", "17.0.1"]
72+
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- name: install OpenJDK
77+
run: choco install openjdk --version ${{ matrix.java-version }}
78+
79+
- run: java -version
80+
81+
- name: build and test
82+
run: .\gradlew.bat --no-daemon test
83+
84+
- name: save test results
85+
run: |
86+
mkdir .\junit
87+
cp build/test-results/test/*.xml junit
88+
89+
- uses: actions/upload-artifact@v4
90+
with:
91+
name: ${{ matrix.java-version }} junit results
92+
path: .\junit

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ This version of the library is used by the LaunchDarkly server-side Java SDK, wh
5151

5252
It is important to keep unit test coverage as close to 100% as possible in this project.
5353

54-
You can view the latest code coverage report in CircleCI, as `coverage/html/index.html` in the artifacts for the "Java 11 - Linux - OpenJDK" job. You can also run the report locally with `./gradlew jacocoTestCoverage` and view `./build/reports/jacoco/test`.
54+
You can view the latest code coverage report through GitHub actions. You can also run the report locally with `./gradlew jacocoTestCoverage` and view `./build/reports/jacoco/test`.
5555

5656
Sometimes a gap in coverage is unavoidable, usually because the compiler requires us to provide a code path for some condition that in practice can't happen and can't be tested, or because of a known issue with the code coverage tool. Please handle all such cases as follows:
5757

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# okhttp-eventsource
22

3-
[![Circle CI](https://circleci.com/gh/launchdarkly/okhttp-eventsource.svg?style=shield)](https://circleci.com/gh/launchdarkly/okhttp-eventsource)
3+
[![Actions Status](https://github.com/launchdarkly/okhttp-eventsource/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/launchdarkly/okhttp-eventsource/actions/workflows/ci.yml)
44
[![Javadocs](http://javadoc.io/badge/com.launchdarkly/okhttp-eventsource.svg)](http://javadoc.io/doc/com.launchdarkly/okhttp-eventsource)
55

66
## Overview

0 commit comments

Comments
 (0)