Skip to content
Snippets Groups Projects
test.yml 5.71 KiB
Newer Older
name: Test

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
Griefed's avatar
Griefed committed
#===================================#
#               JAVA                #
#===================================#
  gradle:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
Griefed's avatar
Griefed committed
      - name: Set up JDK 8
        uses: actions/setup-java@v2
        with:
          distribution: 'adopt'
          java-version: '8'
      - name: Where is Java
        run: which java
#      - name: Grant execute permission for gradlew
#        run: chmod +x gradlew
#      - name: Build with Gradle
#        run: ./gradlew about installQuasar cleanFrontend assembleFrontend copyDist build --info
#      - name: List files in libs
#        run: ls -ahl build/libs
#      - uses: actions/upload-artifact@v2
#        with:
#          name: build-artifacts-gradle
#          path: build/libs/
#          if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
#      - uses: actions/upload-artifact@v2
#        if: failure()
#        with:
#          name: gradle-report
#          path: build/reports/tests/test/
#          if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
Griefed's avatar
Griefed committed
#
#===================================#
#              QUASAR               #
#===================================#
  quasar:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup Node.js environment
        uses: actions/setup-node@v2.5.0
Griefed's avatar
Griefed committed
        with:
          # Version Spec of the version to use.  Examples: 12.x, 10.15.1, >=10.15.0
          node-version: '>= 16.13.1'
Griefed's avatar
Griefed committed
          # Set this option if you want the action to check for the latest available version that satisfies the version spec
          check-latest: false
#      - run: npm install -g @quasar/cli
#      - run: npm install
#      - run: quasar build
#      - run: pwd && ls -al *
#      - uses: actions/upload-artifact@v2
#        with:
#          name: build-artifacts
#          path: dist/spa/ # frontend/dist/spa if Gradle Spring Boot project for example
#          if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`
Griefed's avatar
Griefed committed
#
#===================================#
#              DOCKER               #
#===================================#
  docker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Get branch name
        id: branch-name
        uses: tj-actions/branch-names@v5

      - name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: griefed
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      - name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

Griefed's avatar
Griefed committed
      - name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
#        uses: docker/build-push-action@v2
#        with:
#          context: .
Griefed's avatar
Griefed committed
#          file: ./Dockerfile
#          build-args: BRANCH_OR_TAG=${{ steps.branch-name.outputs.current_branch }}
#          platforms: linux/amd64,linux/arm64 # Add linux/arm/v7 if applicable
#          push: true
#          tags: |
#            ghcr.io/griefed/REPOSITORY:${{ steps.branch-name.outputs.current_branch }}
#            ghcr.io/griefed/REPOSITORY:${{ steps.branch-name.outputs.current_branch }}-${{ github.sha }}
#            griefed/REPOSITORY:${{ steps.branch-name.outputs.current_branch }}
#            griefed/REPOSITORY:${{ steps.branch-name.outputs.current_branch }}-${{ github.sha }}
Griefed's avatar
Griefed committed
#===================================#
#             ELECTRON              #
#===================================#
  electron:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [macos-latest, ubuntu-latest, windows-latest]
    steps:
      - name: Checkout latest code
        uses: actions/checkout@master
        with:
          fetch-depth: 0
Griefed's avatar
Griefed committed
      - name: We are running on
        run: echo matrix.os is ${{ matrix.os }}
        # Either:
        #  1. macos-latest
        #  2. ubuntu-latest
        #  3. windows-latest
      - name: Setup Node.js environment
        uses: actions/setup-node@v2.5.0
Griefed's avatar
Griefed committed
        with:
          # Version Spec of the version to use.  Examples: 12.x, 10.15.1, >=10.15.0
          node-version: '>= 16.9.1'
          # Set this option if you want the action to check for the latest available version that satisfies the version spec
          check-latest: false

#      - name: Build/release Electron app
#        uses: vedaprakashms/quasar_electron_build@V0.0.1
#        with:
#          # GitHub token, automatically provided to the action
#          # (No need to define this secret in the repo settings)
#          github_token: ${{ secrets.github_token }}
#
#      - name: List files
#        run: ls dist/electron
#
#      - name: Rename folders
#        run: |
#          mv dist/electron/REPOSITORY* REPOSITORY-${{ matrix.os }}
#
#      # Electron Archives
#      - name: Create zip
#        uses: ihiroky/archive-action@v1
#        with:
#          root_dir: REPORITORY-${{ matrix.os }}
#          file_path: REPORITORY-app-${{ matrix.os }}.zip
#          verbose: true
#      - name: Create tar.gz
#        run: |
#          tar -cvzf REPOSITORY-app-${{ matrix.os }}-${{ needs.release.outputs.newtag }}.tar.gz REPOSITORY-${{ matrix.os }}
#
#      - name: List files
#      - uses: actions/upload-artifact@v2
#        with:
#          name: electron-artifacts ${{ matrix.os }}
#          path: |
#            dist/electron/
#            !dist/electron/UnPackaged
#          if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`