Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Commit

Permalink
ci: better ci workflows and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TomerFi committed Jul 19, 2021
1 parent 3c8d128 commit 7037e3a
Show file tree
Hide file tree
Showing 16 changed files with 147 additions and 88 deletions.
7 changes: 6 additions & 1 deletion .github/CONTRIBUTING.md
@@ -1,4 +1,4 @@
# Contributing to `hebcal-api`
# Contributing to `hebcal-api`</br>[![conventional-commits]][0]

:clap: First off, thank you for taking the time to contribute. :clap:

Expand Down Expand Up @@ -51,3 +51,8 @@ mvn pitest:mutationCoverage
### Code of Conduct

Please check the [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) document before contributing.

<!-- Real Links -->
[0]: https://conventionalcommits.org
<!-- Badges Links -->
[conventional-commits]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
23 changes: 0 additions & 23 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,38 @@
---
name: Bug Report
description: File a bug report
labels: ["type: bug"]

body:
- type: markdown
attributes:
value: Thanks for taking the time to fill out this bug report!

- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also share, what did you expect to happen?
validations:
required: true

- type: textarea
id: runtime-information
attributes:
label: Please provide runtime information.
description: Runtime information, e.g. Java version
validations:
required: true

- type: textarea
id: log-output
attributes:
label: Relevant log output
description: Please provide any relevant log output. Check for private info before submitting.
render: shell

- type: textarea
id: how-to-reproduce
attributes:
label: How can this issue be reproduced?
description: Instructions on how this issue can be reproduced.
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,6 @@
---
blank_issues_enabled: false
contact_links:
- name: GitHub Discussions
url: https://github.com/TomerFi/hebcal-api/discussions/
about: You can also use Discussions for questions and ideas.
21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,27 @@
---
name: Feature request
description: Suggest an idea for this project
labels: ["type: enhancement"]

body:
- type: markdown
attributes:
value: Thanks for taking the suggest an idea!

- type: textarea
id: feature-idea
attributes:
label: What did you had in mind?
validations:
required: true

- type: textarea
id: is-problem
attributes:
label: Are you trying to fix a problem?
description: If so, please provide as much information as you can.

- type: textarea
id: implementation-idea
attributes:
label: Any lead on how this feature can be implemented?
2 changes: 1 addition & 1 deletion .github/configs/auto_assign.yml
@@ -1,4 +1,4 @@
# https://probot.github.io/apps/auto-assign/
# https://github.com/marketplace/actions/auto-assign-action
---
addReviewers: true
addAssignees: author
Expand Down
1 change: 1 addition & 0 deletions .github/configs/synced_labels.yml
@@ -1,3 +1,4 @@
# https://github.com/marketplace/actions/github-labeler
---
# Type labels
- name: "type: bug"
Expand Down
1 change: 1 addition & 0 deletions .github/dependabot.yml
@@ -1,3 +1,4 @@
# https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
---
version: 2
updates:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/issue_stale.yml
@@ -0,0 +1,24 @@
---
name: Issue stale

on:
schedule:
- cron: "0 */3 * * *"

jobs:
check-stale:
runs-on: ubuntu-latest
name: Check for stale issues
steps:
- name: Mark non-confirmed stale issues
uses: actions/stale@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: >
This issue has been automatically marked as stale because it has not had
any recent activity. It will be closed if no further activity occurs.
close-issue-message: "Closing this issue."
days-before-stale: 30
days-before-close: 3
stale-issue-label: "status: stale"
exempt-issue-labels: "status: confirmed,status: on-hold,type: todo,type: wip"
2 changes: 1 addition & 1 deletion .github/workflows/milestone_cleanup.yml
Expand Up @@ -5,7 +5,7 @@ on:
issues:
types: [deleted, closed, milestoned, demilestoned]
pull_request:
types: [closed, milestoned, demilestoned]
types: [closed]

jobs:
close-finished:
Expand Down
39 changes: 24 additions & 15 deletions .github/workflows/pr_build.yml
Expand Up @@ -46,31 +46,34 @@ jobs:
- name: Source checkout
uses: actions/checkout@v2.3.4

- name: Set up Java 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

- name: Cache maven repository
uses: actions/cache@v2.1.6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: ${{ runner.os }}-maven-

- name: Set up Java 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

- name: Verify the project and create coverage report
run: mvn clean verify jacoco:report -B -ff

- name: Upload coverage report as artifact
- name: Upload coverage reports
uses: actions/upload-artifact@v2.2.4
with:
name: coverage-report
path: target/site/jacoco/jacoco.xml
name: reports
if-no-files-found: error
path: |
target/site/jacoco/jacoco.xml
target/junit-platform/TEST-junit-jupiter.xml
coverage:
report:
runs-on: ubuntu-latest
name: Push coverage report to codecov
name: Push coverage report and test results
needs: build
steps:
- name: Source checkout
Expand All @@ -79,12 +82,18 @@ jobs:
- name: Download coverage report from artifacts
uses: actions/download-artifact@v2
with:
name: coverage-report
name: reports
path: reports

- name: Report test summary
uses: EnricoMi/publish-unit-test-result-action@v1.19
if: always()
with:
test_changes_limit: 0
files: reports/junit-platform/TEST-junit-jupiter.xml

- name: Push to codecov
uses: codecov/codecov-action@v1.5.2
with:
file: jacoco.xml
flags: unit-tests
name: hebcal-api-codecov
file: reports/site/jacoco/jacoco.xml
fail_ci_if_error: true
2 changes: 0 additions & 2 deletions .github/workflows/pr_review.yml
Expand Up @@ -3,8 +3,6 @@ name: Pull request review

on:
pull_request_review:
branches:
- master
types: [submitted, edited]

jobs:
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/pre_release.yml
Expand Up @@ -15,34 +15,31 @@ jobs:
- name: Source checkout
uses: actions/checkout@v2.3.4

- name: Set up Java 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

- name: Cache Maven Repository
uses: actions/cache@v2.1.6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: ${{ runner.os }}-maven-

- name: Set up Java 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

- name: Verify Project
run: mvn verify jacoco:report -B -ff

- name: Create Release
uses: marvinpinto/action-automatic-releases@v1.2.1
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: latest
automatic_release_tag: early-access
title: early-access

- name: Push to CodeCov
uses: codecov/codecov-action@v1.5.2
with:
file: target/site/jacoco/jacoco.xml
flags: unit-tests
name: hebcal-api-codecov
fail_ci_if_error: true
19 changes: 9 additions & 10 deletions .github/workflows/release.yml
Expand Up @@ -7,26 +7,27 @@ on:
- '[0-9].[0-9].[0-9]'

jobs:
pre-release:
release:
if: github.actor == 'TomerFi'
runs-on: ubuntu-latest
name: Build and pre-release latest
name: Build release and push to maven central
steps:
- name: Source checkout
uses: actions/checkout@v2.3.4

- name: Set up Java 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

- name: Cache Maven Repository
uses: actions/cache@v2.1.6
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }}
restore-keys: ${{ runner.os }}-maven-

- name: Set up Java 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

- name: Verify Project
run: mvn verify jacoco:report -B -ff

Expand All @@ -40,6 +41,4 @@ jobs:
uses: codecov/codecov-action@v1.5.2
with:
file: target/site/jacoco/jacoco.xml
flags: unit-tests
name: hebcal-api-codecov
fail_ci_if_error: true
4 changes: 1 addition & 3 deletions README.md
@@ -1,5 +1,5 @@
<!-- markdownlint-disable MD013 -->
# A Java API encapsulating HebCal's REST API</br>[![maven-central-version]][7] [![java-min-version]][11] [![javadoc-io-badge]][9]</br>[![gh-build-status]][0] [![codecov-coverage]][1] [![conventional-commits]][2]
# A Java API encapsulating HebCal's REST API</br>[![maven-central-version]][7] [![java-min-version]][11] [![javadoc-io-badge]][9]</br>[![gh-build-status]][0] [![codecov-coverage]][1]
<!-- markdownlint-enable MD013 -->

The library offers a Java service and provider encapsulating [HebCal][3]'s REST API.
Expand Down Expand Up @@ -71,7 +71,6 @@ API.
<!-- Real Links -->
[0]: https://github.com/TomerFi/hebcal-api/actions?query=workflow%3APre-release
[1]: https://codecov.io/gh/TomerFi/hebcal-api
[2]: https://conventionalcommits.org
[3]: https://www.hebcal.com/
[4]: https://www.hebcal.com/shabbat
[5]: https://www.hebcal.com/home/197/shabbat-times-rest-api
Expand All @@ -83,7 +82,6 @@ API.
[11]: https://openjdk.java.net/projects/jdk/11/
<!-- Badges Links -->
[codecov-coverage]: https://codecov.io/gh/TomerFi/hebcal-api/branch/master/graph/badge.svg
[conventional-commits]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
[gh-build-status]: https://github.com/TomerFi/hebcal-api/workflows/Release/badge.svg
[maven-central-version]: https://badgen.net/maven/v/maven-central/info.tomfi.hebcal/hebcal-api?icon=maven&label=Maven%20Central
[javadoc-io-badge]: https://javadoc.io/badge2/info.tomfi.hebcal/hebcal-api/Javadoc.io.svg
Expand Down

0 comments on commit 7037e3a

Please sign in to comment.