Skip to content

Commit

Permalink
Merge pull request #247 from retest/feature/github-actions
Browse files Browse the repository at this point in the history
Build and deploy with GitHub Actions
  • Loading branch information
mergify[bot] authored Apr 1, 2020
2 parents 5dbf231 + 8d1810d commit d25c2e8
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- [ ] the code follows the [Clean Code](https://clean-code-developer.com/) guidelines.
- [ ] the necessary tests are either created or updated.
- [ ] all status checks (Travis CI, SonarCloud, etc.) pass.
- [ ] all status checks (GitHub Actions, SonarCloud, etc.) pass.
- [ ] your commit history is cleaned up.
- [ ] you updated the changelog.
- [ ] you updated necessary documentation within [retest/docs](https://github.com/retest/docs).
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on: [push, pull_request]

env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2

# fetch unshallow to enable blame for Sonar
- name: Fetch unshallow
run: git fetch --prune --unshallow

- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8

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

- name: Cache Sonar
uses: actions/cache@v1
with:
path: ~/.sonar/cache/
key: ${{ runner.os }}-sonar

- name: Build with Maven
run: >
mvn --batch-mode verify sonar:sonar -Pcoverage
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.organization=retest
-Dsonar.projectKey=de.retest:recheck.cli
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
push:
tags: v*

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8

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

- name: Package with Maven
id: maven_package
run: |
mvn --batch-mode package -DskipTests
cd ./target/
echo "::set-output name=zip_name::$(echo recheck.cli-*-bin.zip)"
- name: Create release
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true

- name: Upload release asset
id: upload_release_asset
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/${{ steps.maven_package.outputs.zip_name }}
asset_name: ${{ steps.maven_package.outputs.zip_name }}
asset_content_type: application/zip
9 changes: 0 additions & 9 deletions .travis.settings.xml

This file was deleted.

32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# <a href="https://retest.dev"><img src="https://assets.retest.org/retest/ci/logos/recheck-screen.svg" width="300"/></a>.cli

[![Build Status](https://travis-ci.com/retest/recheck.cli.svg?branch=master)](https://travis-ci.com/retest/recheck.cli)
![.github/workflows/build.yml](https://github.com/retest/recheck.cli/workflows/.github/workflows/build.yml/badge.svg)
[![license](https://img.shields.io/badge/license-AGPL-brightgreen.svg)](https://github.com/retest/recheck.cli/blob/master/LICENSE)
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg)](https://github.com/retest/recheck.cli/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22)
[![code with hearth by retest](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-retest-C1D82F.svg)](https://retest.de/)
Expand Down
12 changes: 0 additions & 12 deletions ci/script.sh

This file was deleted.

0 comments on commit d25c2e8

Please sign in to comment.