configure java tests and libraries #1786
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
SERVER_TAG: ghcr.io/eclipse/openvsx-server | |
WEBUI_TAG: ghcr.io/eclipse/openvsx-webui | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 18.x | |
- name: Set up JDK | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Install Yarn | |
run: | | |
corepack enable | |
corepack prepare yarn@stable --activate | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # Sonar needs blame info | |
- name: Set Image Version | |
run: echo "IMAGE_VERSION=${GITHUB_SHA:0:7}" >> $GITHUB_ENV | |
- name: Build CLI | |
run: yarn --cwd cli | |
- name: Build Web UI Image | |
run: docker build -t $WEBUI_TAG:$IMAGE_VERSION webui | |
- name: Run Server Tests | |
run: server/gradlew --no-daemon -p server check | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Gradle packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Build Server Image | |
run: docker build -t $SERVER_TAG:$IMAGE_VERSION server | |
- name: Push Docker Images | |
run: | | |
echo ${{ secrets.BOT_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | |
docker push $SERVER_TAG:$IMAGE_VERSION | |
docker push $WEBUI_TAG:$IMAGE_VERSION | |
if: github.repository == 'eclipse/openvsx' && github.ref == 'refs/heads/master' |