Skip to content

Commit

Permalink
Create GH actions config
Browse files Browse the repository at this point in the history
Creates GH Actions config.
  • Loading branch information
manovotn committed Nov 25, 2020
1 parent d3f9055 commit 04da4d0
Showing 1 changed file with 346 additions and 0 deletions.
346 changes: 346 additions & 0 deletions .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,346 @@
name: Weld Parent CI

on:
pull_request:
branches: [ master ]
env:
WFLY_EE8: https://ci.wildfly.org/guestAuth/repository/download/WF_Nightly/latest.lastSuccessful/wildfly-latest-SNAPSHOT.zip
# TODO replace with actual EE9 variant
WFLY_EE9: https://ci.wildfly.org/guestAuth/repository/download/WF_Nightly/latest.lastSuccessful/wildfly-latest-SNAPSHOT.zip

jobs:
# Preparation job that builds the cache, prepares snapshots and server
build-jdk11:
name: "Initial Weld ${{matrix.branch}} Build + WildFly patch"
runs-on: ubuntu-latest
strategy:
matrix:
branch: [master, 3.1]
steps:
- name: Checkout Weld Parent repo
uses: actions/checkout@v2
with:
path: parent
- name: Checkout Weld repo
uses: actions/checkout@v2
with:
repository: weld/core
path: core
ref: ${{matrix.branch}}
- name: Set up JDK
uses: actions/setup-java@v1.4.3
with:
java-version: 11
- name: Download WildFly
run: |
cd $GITHUB_WORKSPACE
if [[ ${{matrix.branch}} == 3.1 ]]
then
echo "Downloading WFLY for EE 8"
wget $WFLY_EE8
else
echo "Downloading WFLY for EE 9"
wget $WFLY_EE9
fi
unzip wildfly-latest-SNAPSHOT.zip
# ZIP contains two more ZIPs, sources and actual WFLY
rm wildfly-*-src.zip
rm wildfly-latest-SNAPSHOT.zip
unzip wildfly-*.zip -d container
- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v2
with:
path: ~/.m2/repository
# Caching is an automated pre/post action that installs the cache if the key exists and exports the cache
# after the job is done. In this case we refresh the cache monthly (by changing key) to avoid unlimited growth.
key: q2maven-${{matrix.branch}}-${{ steps.get-date.outputs.date }}
- name: Build Weld Parent SNAPSHOT
run: |
mvn clean install -DskipTests -B -V -f parent/pom.xml
- name: Update Parent in Core and Build
run: |
PARENT_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec -f parent/pom.xml)
sed -i -e "/<parent>/,/<\/parent>/ s|<version>[0-9a-z.]\{1,\}</version>|<version>${PARENT_VERSION}</version>|g" core/pom.xml
cd core
mvn clean install -DskipTests -B -V
cd ..
- name: Patch WildFly
run: |
JBOSS_HOME=`pwd`'/container/*'
export JBOSS_HOME=`echo $JBOSS_HOME`
mvn clean package -Pupdate-jboss-as -Dtck -f core/jboss-as/pom.xml
- name: Zip Patched WildFly
run: |
cd container/
mv ./* wildfly/
zip -r wildfly.zip wildfly
cd ..
- name: Persist WildFly
uses: actions/upload-artifact@v1
with:
name: wildfly-patched-${{matrix.branch}}-zip
path: container/wildfly.zip
- name: Tar Maven Repo
shell: bash
run: tar -czf maven-repo.tgz -C ~ .m2/repository
- name: Persist Maven Repo
uses: actions/upload-artifact@v1
with:
name: maven-repo-${{matrix.branch}}
path: maven-repo.tgz
- name: Delete Local Artifacts From Cache
shell: bash
run: rm -r ~/.m2/repository/org/jboss/weld*

# Weld in-container tests, does NOT include TCKs which are run as a separate job
incontainer-tests:
name: "Weld ${{matrix.branch}} In-container Tests - JDK ${{matrix.java.name}}"
runs-on: ubuntu-latest
needs: build-jdk11
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
java:
- { name: "8",
java-version: 8,
}
- {
name: "11",
java-version: 11,
}
branch: [master, 3.1]
steps:
- name: Checkout Weld Parent repo
uses: actions/checkout@v2
with:
path: parent
- name: Checkout Weld repo
uses: actions/checkout@v2
with:
repository: weld/core
path: core
ref: ${{matrix.branch}}
- name: Set up JDK ${{ matrix.java.name }}
uses: actions/setup-java@v1.4.3
with:
java-version: ${{ matrix.java.java-version }}

- name: Download Maven Repo
uses: actions/download-artifact@v1
with:
name: maven-repo-${{matrix.branch}}
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Download Patched WildFly
uses: actions/download-artifact@v1
with:
name: wildfly-patched-${{matrix.branch}}-zip
path: .
- name: Extract WildFly
run: unzip wildfly.zip
- name: Build with Maven
run: |
PARENT_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec -f parent/pom.xml)
sed -i -e "/<parent>/,/<\/parent>/ s|<version>[0-9a-z.]\{1,\}</version>|<version>${PARENT_VERSION}</version>|g" core/pom.xml
JBOSS_HOME=`pwd`'/wildfly'
export JBOSS_HOME=`echo $JBOSS_HOME`
mvn clean verify -Dincontainer -pl '!jboss-tck-runner' -f core/pom.xml
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -name '*-reports' -type d | tar -czf test-reports.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v1
if: failure()
with:
name: test-reports-incontainer-jdk${{matrix.java.name}}-${{matrix.branch}}
path: 'test-reports.tgz'

# CDI TCKs in WildFly
CDI-TCK:
name: "Weld ${{matrix.branch}} CDI TCK - JDK ${{matrix.java.name}}"
runs-on: ubuntu-latest
needs: build-jdk11
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
java:
- { name: "8",
java-version: 8,
}
- {
name: "11",
java-version: 11,
}
branch: [master, 3.1]
steps:
- name: Checkout Weld Parent repo
uses: actions/checkout@v2
with:
path: parent
- name: Checkout Weld repo
uses: actions/checkout@v2
with:
repository: weld/core
path: core
ref: ${{matrix.branch}}
- name: Set up JDK ${{ matrix.java.name }}
uses: actions/setup-java@v1.4.3
with:
java-version: ${{ matrix.java.java-version }}
- name: Download Maven Repo
uses: actions/download-artifact@v1
with:
name: maven-repo-${{matrix.branch}}
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Download Patched WildFly
uses: actions/download-artifact@v1
with:
name: wildfly-patched-${{matrix.branch}}-zip
path: .
- name: Extract WildFly
run: unzip wildfly.zip
- name: Build with Maven
run: |
PARENT_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec -f parent/pom.xml)
sed -i -e "/<parent>/,/<\/parent>/ s|<version>[0-9a-z.]\{1,\}</version>|<version>${PARENT_VERSION}</version>|g" core/pom.xml
JBOSS_HOME=`pwd`'/wildfly'
export JBOSS_HOME=`echo $JBOSS_HOME`
mvn clean verify -Dincontainer -f core/jboss-tck-runner/pom.xml
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -name '*-reports' -type d | tar -czf test-reports.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v1
if: failure()
with:
name: test-reports-cdi-tck-jdk${{matrix.java.name}}-${{matrix.branch}}
path: 'test-reports.tgz'

# Weld no-container tests, includes junit, Weld SE tests plus CDI TCKs and integration tests that don't require EE container
no-container-tests:
name: "Weld ${{matrix.branch}} Tests w/o Container - JDK ${{matrix.java.name}}"
runs-on: ubuntu-latest
needs: build-jdk11
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
java:
- { name: "8",
java-version: 8,
}
- {
name: "11",
java-version: 11,
}
branch: [master, 3.1]
steps:
- name: Checkout Weld Parent repo
uses: actions/checkout@v2
with:
path: parent
- name: Checkout Weld repo
uses: actions/checkout@v2
with:
repository: weld/core
path: core
ref: ${{matrix.branch}}
- name: Set up JDK ${{ matrix.java.name }}
uses: actions/setup-java@v1.4.3
with:
java-version: ${{ matrix.java.java-version }}
- name: Download Maven Repo
uses: actions/download-artifact@v1
with:
name: maven-repo-${{matrix.branch}}
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Build with Maven
run: |
PARENT_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec -f parent/pom.xml)
sed -i -e "/<parent>/,/<\/parent>/ s|<version>[0-9a-z.]\{1,\}</version>|<version>${PARENT_VERSION}</version>|g" core/pom.xml
mvn clean verify -f core/pom.xml
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -name '*-reports' -type d | tar -czf test-reports.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v1
if: failure()
with:
name: test-reports-no-container-jdk${{matrix.java.name}}-${{matrix.branch}}
path: 'test-reports.tgz'

# CDI TCK for SE environment
CDI-TCK-SE:
name: "Weld ${{matrix.branch}} CDI TCK SE - JDK ${{matrix.java.name}}"
runs-on: ubuntu-latest
needs: build-jdk11
timeout-minutes: 120
strategy:
fail-fast: false
matrix:
java:
- { name: "8",
java-version: 8,
}
- {
name: "11",
java-version: 11,
}
branch: [master, 3.1]
steps:
- name: Checkout Weld Parent repo
uses: actions/checkout@v2
with:
path: parent
- name: Checkout Weld repo
uses: actions/checkout@v2
with:
repository: weld/core
path: core
ref: ${{matrix.branch}}
- name: Set up JDK ${{ matrix.java.name }}
uses: actions/setup-java@v1.4.3
with:
java-version: ${{ matrix.java.java-version }}
- name: Download Maven Repo
uses: actions/download-artifact@v1
with:
name: maven-repo-${{matrix.branch}}
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzf maven-repo.tgz -C ~
- name: Build with Maven
run: |
PARENT_VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec -f parent/pom.xml)
sed -i -e "/<parent>/,/<\/parent>/ s|<version>[0-9a-z.]\{1,\}</version>|<version>${PARENT_VERSION}</version>|g" core/pom.xml
mvn clean verify -Dincontainer=se -f core/jboss-tck-runner/pom.xml
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -name '*-reports' -type d | tar -czf test-reports.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v1
if: failure()
with:
name: test-reports-cdi-tck-se-jdk${{matrix.java.name}}-${{matrix.branch}}
path: 'test-reports.tgz'

0 comments on commit 04da4d0

Please sign in to comment.