Skip to content

Commit

Permalink
Create build-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
robertberes authored Dec 3, 2022
1 parent 3bcffd8 commit d712678
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/build-test.yml
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

0 comments on commit d712678

Please sign in to comment.