forked from crowdin/crowdin-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3bcffd8
commit d712678
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: build-test | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
paths-ignore: | ||
- 'README.md' | ||
- 'CHANGELOG.md' | ||
- 'CODE_OF_CONDUCT.md' | ||
- 'CONTRIBUTING.md' | ||
- 'LICENSE' | ||
pull_request: | ||
branches: [ 'cli3' ] | ||
|
||
jobs: | ||
build: | ||
runs-on: [ ubuntu-latest ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 8 | ||
cache: 'gradle' | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Execute Gradle build | ||
run: ./gradlew build | ||
|
||
- name: Build executable jar file | ||
run: ./gradlew shadowJar | ||
|
||
- name: Generate autocomplete script | ||
run: | | ||
cd build/libs | ||
java -cp crowdin-cli-*.jar picocli.AutoComplete com.crowdin.cli.commands.picocli.RootCommand | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: | | ||
build/libs/crowdin-cli-*.jar | ||
build/libs/crowdin_completion | ||
test: | ||
needs: build | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 8 | ||
cache: 'gradle' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Run Tests | ||
run: ./gradlew test | ||
|
||
- name: Test Report | ||
uses: dorny/test-reporter@v1 | ||
if: success() || failure() | ||
with: | ||
name: Test results ${{ matrix.os }} | ||
path: build/test-results/test/*.xml | ||
reporter: java-junit | ||
|
||
- name: Generate code coverage report | ||
run: ./gradlew build jacocoTestReport |