Updates GitHub Actions #114
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: MicroShed CI | |
on: | |
push: | |
pull_request: | |
branches: | |
- master | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths-ignore: | |
- '.gitignore' | |
- '.dockerignore' | |
- '*.md' | |
- '*.adoc' | |
- '*.txt' | |
- '.github/ISSUE_TEMPLATE/**' | |
env: | |
LANG: en_US.UTF-8 | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
java: [ 11 ] | |
fail-fast: false | |
max-parallel: 4 | |
name: Build ${{ matrix.java }}, ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: 'zulu' | |
- name: Apply repository caches | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches/modules-2 | |
!~/.gradle/caches/modules-2/org.microshed* | |
~/.gradle/wrapper | |
~/.m2/repository/ | |
!~/.m2/repository/org/microshed/ | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Build with Gradle | |
run: | | |
chmod +x gradlew | |
./gradlew assemble testClasses | |
integration_tests: | |
name: Tests - ${{matrix.category}} | |
runs-on: ubuntu-latest | |
needs: build | |
timeout-minutes: 20 | |
strategy: | |
fail-fast: false | |
max-parallel: 18 | |
matrix: | |
include: | |
- category: JAXRS | |
projects: > | |
jaxrs-json | |
jaxrs-basicauth | |
jaxrs-mpjwt | |
everything-app | |
- category: GENERAL | |
projects: > | |
maven-app | |
everything-app | |
jdbc-app | |
kafka-app | |
- category: LIBERTY/PAYARA | |
projects: > | |
liberty-app | |
payara-app | |
- category: QUARKUS/WILDFLY | |
projects: > | |
quarkus-app | |
wildfly-app | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: 'zulu' | |
- name: Apply repository caches | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches/modules-2 | |
!~/.gradle/caches/modules-2/org.microshed* | |
~/.gradle/wrapper | |
~/.m2/repository/ | |
!~/.m2/repository/org/microshed/ | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Setup docker host | |
run: echo "DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock" >> "$GITHUB_ENV" | |
- name: Update podman | |
run: | | |
sudo apt-get -y purge podman | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] \ | |
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ | |
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | |
sudo apt-get update -qq | |
sudo apt-get -qq -y install podman | |
# Runs a single command using the runners shell | |
- name: Check podman | |
run: docker version | |
- name: Set up testcontainers for podman | |
run: | | |
echo ryuk.container.privileged=true > ~/.testcontainers.properties | |
- name: Run integration tests | |
shell: bash | |
env: | |
TEST_PROJECTS: ${{matrix.projects}} | |
CATEGORY: ${{matrix.category}} | |
run: | | |
chmod +x gradlew | |
echo "org.gradle.daemon=false" >> gradle.properties | |
echo "Will be running projects $TEST_PROJECTS" | |
for TEST_PROJECT in $TEST_PROJECTS | |
do | |
if [[ ! -d "sample-apps/$TEST_PROJECT" ]]; then | |
echo "::error::Test project $TEST_PROJECT does not exist."; | |
exit 1; | |
fi | |
echo "### BEGIN running test project $TEST_PROJECT" | |
./gradlew :microshed-testing-$TEST_PROJECT:test | |
echo "### END running test project $TEST_PROJECT"; | |
done | |
echo "Done running all tests." |