Bump nanoid from 3.1.30 to 3.3.6 in /web #1243
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: Build and test | |
on: | |
push: | |
branches: [dev, master] | |
tags: | |
- 'v*.*.*' | |
- 'v*.*.*-beta*' | |
pull_request: | |
jobs: | |
wrapper-check: | |
name: Validate Gradle wrapper | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: gradle/wrapper-validation-action@v1 | |
license: | |
name: License headers | |
runs-on: ubuntu-latest | |
needs: [ wrapper-check ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Check license headers | |
run: ./gradlew license | |
backend-tests: | |
name: Build and test back-end | |
runs-on: ubuntu-latest | |
needs: [ wrapper-check, license ] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # Required for Codecov | |
- uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Build with Gradle | |
run: ./gradlew jar | |
- name: Test with gradle | |
run: ./gradlew check | |
- name: Create and upload code coverage report | |
run: | | |
./gradlew jacocoTestReport | |
bash <(curl -s https://codecov.io/bash) -f bot/build/reports/jacoco/test/jacocoTestReport.xml | |
- name: Upload tests failure report to artifacts | |
uses: actions/upload-artifact@v1 | |
if: failure() | |
with: | |
name: failure-reports | |
path: bot/build/reports | |
docs: | |
name: Generate docs | |
runs-on: ubuntu-latest | |
needs: [ wrapper-check, license ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Generate documentation | |
run: ./gradlew :docs:build | |
frontend-build: | |
name: Build front-end | |
runs-on: ubuntu-latest | |
needs: [ wrapper-check, license ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Compile front-end JAR | |
run: ./gradlew frontJar -PwithFrontend | |
full-dist-build: | |
needs: [ wrapper-check, license, backend-tests, frontend-build, docs ] | |
name: Full distribution build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Build frontend-less dist | |
run: ./gradlew assembleDist | |
- name: Build dist with bundled front-end | |
run: ./gradlew assembleDist -PwithFrontend | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: distribution-archive-zip | |
path: | | |
bot/build/distributions/epilink-backend-*.zip | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: distribution-archive-tar | |
path: | | |
bot/build/distributions/epilink-backend-*.tar | |
docker-image-build: | |
needs: [license, backend-tests, frontend-build, docs] | |
name: Build Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Docker image | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: false # Explicitly disable this just in case | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
- name: Detect stable or beta version | |
id: check-version | |
run: | | |
TAG_NAME="${GITHUB_REF#refs/*/}" | |
if [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
echo "Stable version" | |
echo ::set-output name=stable::true | |
echo "RELEASE_VERSION=${TAG_NAME:1}" >> $GITHUB_ENV | |
elif [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+-beta[0-9]+$ ]]; then | |
echo "Beta version" | |
echo ::set-output name=beta::true | |
echo "RELEASE_VERSION=${TAG_NAME:1}" >> $GITHUB_ENV | |
else | |
echo "Unknown tag format: ${{ github.event.ref }}" | |
fi | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
if: steps.check-version.outputs.stable == 'true' || steps.check-version.outputs.beta == 'true' | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Upload Docker image to Docker Hub (stable -> latest + version) | |
if: steps.check-version.outputs.stable == 'true' | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: "litarvan/epilink:latest,litarvan/epilink:${{ env.RELEASE_VERSION }}" | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
- name: Upload Docker image to Docker Hub (beta -> version) | |
if: steps.check-version.outputs.beta == 'true' | |
uses: docker/build-push-action@v2 | |
with: | |
push: true | |
tags: "litarvan/epilink:${{ env.RELEASE_VERSION }}" | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |