Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates CI workflows and bumps action versions #22

Merged
merged 4 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 0 additions & 81 deletions .github/workflows/ci.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint
# Lint workflow runs Kotlin linter (ktlint) on the code base.

# This workflow is run on every pull request and push to main.
# If no *.kt files are changed it will pass without running as these are required checks.
on:
pull_request:
paths:
- "**/*.kt"
- "*.gradle.kts"
- ".github/workflows/lint.yml"
push:
branches:
- main

# concurrency is not defined in here because this job usually doesn't
# run long enough to need cancelling, and it's okay for it to run multiple
# times for the same PR.

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint
uses: vroy/gha-kotlin-linter@v4
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release
# Release workflow builds and releases distribution artifacts.

# This workflow is run on pushes to master & every Pull Request,
# if no *.kt files are changed it will pass without running as these are required checks
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+" # Push events to matching #.#.#, i.e. 1.0, 20.15.10
- "[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching #.#.#-rc#, i.e. 1.0-rc1, 20.15.10-rc5

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
distribution: temurin
java-version: 11
- name: Set tag version
run: |
echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Defined tag version
run: |
echo VERSION=$VERSION
- name: Build artifacts
uses: gradle/[email protected]
with:
arguments: assembleDist
- name: Upload artifacts
- uses: ncipollo/release-action@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
artifacts: "build/distributions/*"
bodyFile: "RELEASE_CHANGELOG.md"
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test
# Test workflow runs unit tests and uploads a code coverage report.

# This workflow is run on every pull request and push to main.
# If no *.kt files are changed it will pass without running as these are required checks.
on:
pull_request:
paths:
- "**/*.kt"
- "*.gradle.kts"
- ".github/workflows/test.yml"
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
distribution: temurin
java-version: 11
- name: Test
uses: gradle/[email protected]
with:
arguments: test
- uses: codecov/[email protected]
with:
directory: "build/reports"
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ tasks.withType<KotlinCompile> {
}

tasks.assembleDist {
dependsOn(tasks.test)
finalizedBy("checksumDist") // checksums are generated after assembleDist runs
}

Expand Down