Initial LSP Implementation. (#758) #836
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: Winery CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*.*.*" | |
pull_request: | |
jobs: | |
pre_job: | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
docker_run_required: ${{ (github.repository_owner == 'OpenTOSCA' && (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags'))) }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@master | |
java17: | |
needs: pre_job | |
if: | | |
needs.pre_job.outputs.should_skip != 'true' | |
|| needs.pre_job.outputs.docker_run_required == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check if AbstractResourceTest does not contain log().all(). | |
run: | | |
if grep -i -q '\.all()' org.eclipse.winery.repository.rest/src/test/java/org/eclipse/winery/repository/rest/resources/AbstractResourceTest.java; | |
then | |
echo "Log output should be shortened. Use .ifValidationFails()!"; | |
exit 1; | |
fi | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn -Pjava -B package | |
- name: Upload binary to artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ needs.pre_job.outputs.docker_run_required == 'true' }} | |
with: | |
name: artifacts | |
path: | | |
**/winery.war | |
**/winery-cli.jar | |
- name: Run codacy-coverage-reporter | |
if: ${{ github.repository_owner == 'OpenTOSCA' }} | |
uses: codacy/codacy-coverage-reporter-action@master | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: org.eclipse.winery.reporting/target/site/jacoco-aggregate/jacoco.xml | |
frontend: | |
needs: pre_job | |
if: | | |
needs.pre_job.outputs.should_skip != 'true' | |
|| needs.pre_job.outputs.docker_run_required == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.npm | |
key: npm-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
npm-${{ runner.os }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
cache: 'maven' | |
- name: Build with Maven | |
run: mvn -Pfrontend -B package | |
- name: Upload binary to artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ needs.pre_job.outputs.docker_run_required == 'true' }} | |
with: | |
name: artifacts | |
path: ${{ github.workspace }}/org.eclipse.winery.frontends/target/*.war | |
dockerBuild: | |
needs: [ java17, frontend ] | |
runs-on: ubuntu-latest | |
if: ${{ needs.pre_job.outputs.docker_run_required == 'true' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifacts | |
path: ${{ github.workspace }} | |
- name: Prepare artifacts | |
run: | | |
mv org.eclipse.winery.cli/target/winery-cli.jar winery-cli.jar | |
mv org.eclipse.winery.repository.rest/target/winery.war winery.war | |
ls -al | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: amd64,arm64,arm | |
- name: Set variables | |
id: vars | |
run: | | |
DOCKER_IMAGE=opentosca/winery | |
VERSION=latest | |
SHORTREF=${GITHUB_SHA::8} | |
# If this is git tag, use the tag name | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
VERSION=${GITHUB_REF#refs/tags/v} | |
fi | |
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}" | |
# Set output parameters. | |
echo ::set-output name=tags::${TAGS} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
- name: Build and push latest Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile.noBuild | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.vars.outputs.tags }} | |
- name: Build and push latest CLI Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile.cli | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: 'opentosca/winery-cli:latest' |