Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance CI pipeline #208

Merged
merged 4 commits into from
Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 8 additions & 18 deletions .github/workflows/ci-actions.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,14 @@ jobs:
name: JVM Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: maven
- name: Maven
run: mvn test
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -name '*-reports' -type d | tar -czvf test-reports.tgz -T -
- name: Upload failure archive (if maven failed)
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-reports-jvm
path: 'test-reports.tgz'

native-tests:
name: Native Tests
Expand All @@ -42,8 +32,8 @@ jobs:
flavor: [ "standalone", "enterprise" ]
fail-fast: false
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
Expand All @@ -56,11 +46,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 12.x, 14.x ]
node-version: [ 12, 14 ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Build
Expand All @@ -71,6 +61,6 @@ jobs:
- name: Test
working-directory: src/main/webapp
run: yarn test --coverage --watchAll=false
- uses: codecov/codecov-action@v2.1.0
- uses: codecov/codecov-action@v3
with:
flags: unitests
49 changes: 0 additions & 49 deletions .github/workflows/container-images.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/greetings.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/pr-build-container-images-comment-boot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- name: Set up token
id: token
# This is a base64-encoded OAuth token for the "project-openubl-preview-bot" GitHub account, which has no secure access.
run: echo "::set-output name=GH_TOKEN::`echo 'Z2hwX1dySmRZd1dTdkFVeHlFUDR2bUl4TUhBaHZaeURnNjQxMUNUTAo=' | base64 -d`"
run: echo "::set-output name=GH_TOKEN::`echo 'Z2hwX2Z0VnB1MmdQdXYxSldsMm9nZkoyOFMydzdDTEZvNjBOQXVIZAo=' | base64 -d`"
- name: Post Container image as PR comment
uses: mshick/add-pr-comment@v1
with:
Expand All @@ -17,7 +17,7 @@ jobs:

The creation of the container image might take aproximately 10 minutes. Once it is available you can pull it using:
```shell
docker pull ghcr.io/${{github.event.pull_request.head.repo.full_name}}/${{github.event.repository.name}}:${{github.event.pull_request.head.ref}}
docker pull ghcr.io/${{github.event.pull_request.head.repo.full_name}}/${{github.event.repository.name}}-standalone:${{github.event.pull_request.head.ref}}
docker pull ghcr.io/${{github.event.pull_request.head.repo.full_name}}/${{github.event.repository.name}}-enterprise:${{github.event.pull_request.head.ref}}
```

Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/pr-build-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,13 @@ jobs:
flavor: [ "standalone", "enterprise" ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
cache: maven

- name: Extract image name
shell: bash
run: |
bash -c '
flavor=${{ matrix.flavor }};
image_name="searchpe";
if [ $flavor != "standalone" ]; then
image_name="$image_name-$flavor"
fi
echo $image_name;
echo "##[set-output name=searchpe_image_name;]$(echo $image_name)"'
id: extract_image_name
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
Expand All @@ -43,7 +31,7 @@ jobs:
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.registry=ghcr.io \
-Dquarkus.container-image.group=${{ github.repository_owner }} \
-Dquarkus.container-image.name=${{ github.event.repository.name }}/${{ steps.extract_image_name.outputs.searchpe_image_name }} \
-Dquarkus.container-image.name=${{ github.event.repository.name }}/searchpe-${{ matrix.flavor }} \
-Dquarkus.container-image.tag=${{ steps.extract_branch.outputs.branch }} \
-Dquarkus.container-image.username=${{ github.actor }} \
-Dquarkus.container-image.password=${{ secrets.GITHUB_TOKEN }} \
Expand Down
44 changes: 21 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ on:

jobs:
version:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
Expand All @@ -39,13 +36,12 @@ jobs:
./mvnw -B versions:set versions:commit -DnewVersion=$RELEASE_VERSION
git config --global user.email "[email protected]"
git config --global user.name "Project-Openubl Bot"
git commit -a -m "🏁 Releasing version $RELEASE_VERSION"
git commit --allow-empty -a -m "🏁 Releasing version $RELEASE_VERSION"
git push origin HEAD:master
git rev-parse HEAD > HEAD
echo $RELEASE_VERSION > RELEASE_VERSION
echo $PLAIN_VERSION > PLAIN_VERSION
echo $NEXT_VERSION > NEXT_VERSION

- name: Upload version files
uses: actions/upload-artifact@v2
with:
Expand All @@ -63,7 +59,7 @@ jobs:
flavor: [ "standalone", "enterprise" ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifacts
path: artifacts
Expand All @@ -72,12 +68,11 @@ jobs:
uses: juliangruber/read-file-action@v1
with:
path: artifacts/HEAD
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ steps.head.outputs.content }}

- name: Setup Java
uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
Expand Down Expand Up @@ -111,7 +106,7 @@ jobs:
# gu-binary: gu
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/download-artifact@v2
# - uses: actions/download-artifact@v3
# with:
# name: artifacts
# path: artifacts
Expand All @@ -120,7 +115,7 @@ jobs:
# uses: juliangruber/read-file-action@v1
# with:
# path: artifacts/HEAD
# - uses: actions/checkout@v2
# - uses: actions/checkout@v3
# with:
# ref: ${{ steps.head.outputs.content }}
#
Expand Down Expand Up @@ -158,7 +153,7 @@ jobs:
flavor: [ "standalone", "enterprise" ]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifacts
path: artifacts
Expand All @@ -167,12 +162,11 @@ jobs:
uses: juliangruber/read-file-action@v1
with:
path: artifacts/HEAD
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ steps.head.outputs.content }}

- name: Setup Java
uses: actions/setup-java@v2
- uses: actions/setup-java@v3
with:
java-version: 11
distribution: temurin
Expand Down Expand Up @@ -202,13 +196,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
- name: Read HEAD ref
id: head
uses: juliangruber/read-file-action@v1
with:
path: artifacts/HEAD

- name: Read versions
id: version
run: |
Expand All @@ -221,16 +214,15 @@ jobs:
echo "::set-output name=RELEASE_VERSION::$RELEASE_VERSION"
echo "::set-output name=PLAIN_VERSION::$PLAIN_VERSION"
echo "::set-output name=NEXT_VERSION::$NEXT_VERSION"
- name: Check out repository
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ steps.head.outputs.content }}
fetch-depth: 0

# checkout will clobber downloaded artifacts
# we have to download them again
- name: Download all build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3

- name: Load and config images
run: |
Expand All @@ -241,6 +233,7 @@ jobs:
# Tag images
docker tag quay.io/projectopenubl/searchpe-standalone:latest quay.io/projectopenubl/searchpe:latest
docker tag quay.io/projectopenubl/searchpe-standalone:latest quay.io/projectopenubl/searchpe:${{ steps.version.outputs.RELEASE_VERSION }}
docker tag quay.io/projectopenubl/searchpe-enterprise:latest quay.io/projectopenubl/searchpe-standalone:${{ steps.version.outputs.RELEASE_VERSION }}
docker tag quay.io/projectopenubl/searchpe-enterprise:latest quay.io/projectopenubl/searchpe-enterprise:${{ steps.version.outputs.RELEASE_VERSION }}

- name: Login to Quay.io
Expand All @@ -254,7 +247,10 @@ jobs:
run: |
docker push quay.io/projectopenubl/searchpe:latest
docker push quay.io/projectopenubl/searchpe:v${{ steps.version.outputs.RELEASE_VERSION }}


docker push quay.io/projectopenubl/searchpe-standalone:latest
docker push quay.io/projectopenubl/searchpe-standalone:v${{ steps.version.outputs.RELEASE_VERSION }}

docker push quay.io/projectopenubl/searchpe-enterprise:latest
docker push quay.io/projectopenubl/searchpe-enterprise:v${{ steps.version.outputs.RELEASE_VERSION }}

Expand All @@ -268,6 +264,8 @@ jobs:
JRELEASER_TWITTER_CONSUMER_SECRET: ${{ secrets.JRELEASER_TWITTER_CONSUMER_SECRET }}
JRELEASER_TWITTER_ACCESS_TOKEN: ${{ secrets.JRELEASER_TWITTER_ACCESS_TOKEN }}
JRELEASER_TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.JRELEASER_TWITTER_ACCESS_TOKEN_SECRET }}
JRELEASER_SLACK_TOKEN: ${{ secrets.JRELEASER_SLACK_TOKEN }}
JRELEASER_SLACK_WEBHOOK: ${{ secrets.JRELEASER_SLACK_WEBHOOK }}

- name: Set next version
env:
Expand Down
Loading