111 lines
2.5 KiB
YAML
111 lines
2.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- "**.md"
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
types: [ opened, synchronize, reopened, ready_for_review ]
|
|
paths-ignore:
|
|
- "assets/**"
|
|
- "**.md"
|
|
|
|
concurrency:
|
|
group: build-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
USE_MATERIAL_KOLOR_SUBMODULE: false
|
|
|
|
permissions:
|
|
checks: write
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
verify:
|
|
name: "Verify"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: setup-java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 17
|
|
distribution: adopt
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Gradle Wrapper Validation
|
|
uses: gradle/actions/wrapper-validation@v4
|
|
|
|
- name: Lint
|
|
run: ./gradlew lint --scan
|
|
|
|
- name: Upstream Tests
|
|
run: ./gradlew :app:test --scan
|
|
|
|
build:
|
|
name: "Build"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: setup-java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: 17
|
|
distribution: adopt
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Gradle Wrapper Validation
|
|
uses: gradle/actions/wrapper-validation@v4
|
|
|
|
- name: Build web app
|
|
run: ./gradlew wasmJsBrowserDistribution
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: web-app
|
|
path: app/build/dist/wasmJs/productionExecutable
|
|
|
|
deploy-preview:
|
|
name: "Deploy Preview"
|
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- verify
|
|
- build
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Download build artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: web-app
|
|
path: app/build/dist/wasmJs/productionExecutable
|
|
|
|
- name: Deploy to Firebase
|
|
uses: FirebaseExtended/action-hosting-deploy@v0
|
|
with:
|
|
repoToken: ${{ secrets.GITHUB_TOKEN }}
|
|
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_MATERIALKOLOR }}
|
|
projectId: materialkolor
|