Skip to content

Commit

Permalink
Merge pull request #2629 from MysterAitch/github_actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MysterAitch committed Apr 24, 2020
2 parents 67440dd + 61638e9 commit 668ec84
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/create_github_release.yml
@@ -1,5 +1,3 @@


on:
push:
# Sequence of patterns matched against refs/tags
Expand All @@ -16,6 +14,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand All @@ -25,12 +24,12 @@ jobs:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
## Body content doesn't yet seem to appear in the Github UI
body: |
Bug Fixes:
- TODO: Describe any bug fixes
Enhancements:
- TODO: Describe any new features or enhancements
# body: |
# Bug Fixes:
# - TODO: Describe any bug fixes
#
# Enhancements:
# - TODO: Describe any new features or enhancements
## Option -- trigger as a draft release, followed by the addition of any key release notes and manual approval?
## Alternative -- replace the above body with a link to the changelog? We can always edit release after the fact to add in e.g. notes about breaking changes.
draft: true
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/maven_tests.yml
@@ -0,0 +1,50 @@
name: Build and test (using maven)

on: [push, pull_request]
#on: [pull_request]

jobs:
maven_test:
strategy:
## Optionally cancel all other combinations if one fails
fail-fast: false
matrix:
## Different OSs have different default line-endings -- test on all combinations.
os: [ubuntu-latest, macos-latest, windows-latest]
## Different JDK versions have different implementations etc. -- test on all combinations (ideally 8 to latest).
### exclude pre-8 (min development version jdk8)
### exclude post-12 (changes to jdk causes reflection tests to fail due to added methods #1701 )
jdk: [8,9,10,11,12] # [8,9,10,11,12,13,14,15-ea]

runs-on: ${{ matrix.os }}

steps:
## Checkout the current version of the code from the repo.
- name: Checkout latest code
uses: actions/checkout@v2

## Setup the specified version of Java (includes maven/gradle).
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.jdk }}

## Given that the build matrix only specifies the major version (configurable), output the precise version used.
- name: Echo exact java version being used
run: java -version

## Use a cache to reduce the build/test times (avoids having to download dependencies on EVERY run).
### https://help.github.com/en/actions/language-and-framework-guides/building-and-testing-java-with-maven#caching-dependencies
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

## Actually perform the tests. Unsuccessful tests will indicate a failed build.
### -e : show traces where any errors occur
### -B test : run the maven lifecycle stage `test`
### -P AlsoSlowTests : by default, only quick tests are run - the profile `AlsoSlowTests` runs the full test suite
- name: Test with Maven (incl. slow tests)
run: mvn -e -B test -P AlsoSlowTests

0 comments on commit 668ec84

Please sign in to comment.