Skip to content

Commit

Permalink
chore(ci): add workflow for build, test and lint (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
philprime authored Aug 7, 2024
1 parent 13d1b2f commit 9bf7a10
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
46 changes: 46 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build & Test

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

jobs:
build-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Set the fetch-depth > 1 or set to 0 for codecov upload detection
fetch-depth: 2

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 21
cache: "gradle"

- name: Build with Gradle
run: ./gradlew build --no-daemon

- name: Run tests
run: ./gradlew test --no-daemon

- name: Lint with Gradle
run: ./gradlew lint --no-daemon

- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 9bf7a10

Please sign in to comment.