diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c1af524 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: CI +on: + pull_request: + branches: [ master ] + push: + branches: [ master ] + +# Concurrency strategy: +# github.workflow: distinguish this workflow from others +# github.event_name: distinguish `push` event from `pull_request` event +# github.event.number: set to the number of the pull request if `pull_request` event +# github.run_id: otherwise, it's a `push` or `schedule` event, only cancel if we rerun the workflow +# +# Reference: +# https://docs.github.com/en/actions/using-jobs/using-concurrency +# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }} + cancel-in-progress: true + +jobs: + test: + strategy: + matrix: + os: [ 'ubuntu-latest', 'windows-latest', 'macos-latest'] + java: [ '8', '11', '17', '21' ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Setup Java + uses: actions/setup-java@v4 + with: + cache: 'maven' + distribution: 'zulu' + java-version: ${{ matrix.java }} + - name: Build and test + run: ./test + shell: bash diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e411e6e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: java -sudo: false -os: -- linux -notifications: - email: false -cache: - directories: - - "$HOME/.m2/repository" - - "$HOME/.m2/wrapper" -env: - global: - - _JAVA_OPTIONS= -install: -- true -script: -- "./test" -before_cache: -- rm -fr $HOME/.m2/repository/kr/motd/maven/os-maven-plugin diff --git a/test b/test index aa15a76..a406b9e 100755 --- a/test +++ b/test @@ -1,4 +1,7 @@ -#!/bin/bash -e +#!/usr/bin/env bash + +set -e + cd "$(dirname "$0")" TOP_PROJ_DIR="$PWD" BUILD_SRC_DIR="$PWD/src/build"