mirror of https://github.com/VueTubeApp/VueTube
141 lines
3.9 KiB
YAML
141 lines
3.9 KiB
YAML
|
name: CI
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches:
|
||
|
- main
|
||
|
pull_request:
|
||
|
workflow_dispatch:
|
||
|
|
||
|
env:
|
||
|
NODE_VERSION: 14
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
name: Build web assets
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||
|
uses: actions/setup-node@v2
|
||
|
with:
|
||
|
node-version: ${{ env.NODE_VERSION }}
|
||
|
- name: Install dependencies
|
||
|
run: npm ci
|
||
|
- name: Build web assets
|
||
|
run: npm run build -- --prod
|
||
|
- name: Upload artifacts
|
||
|
uses: actions/upload-artifact@v2
|
||
|
with:
|
||
|
name: www
|
||
|
path: www
|
||
|
android:
|
||
|
name: Build Android platform
|
||
|
runs-on: ubuntu-latest
|
||
|
needs: [build]
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Download artifacts
|
||
|
uses: actions/download-artifact@v2
|
||
|
with:
|
||
|
name: www
|
||
|
path: www
|
||
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||
|
uses: actions/setup-node@v2
|
||
|
with:
|
||
|
node-version: ${{ env.NODE_VERSION }}
|
||
|
- name: Install dependencies
|
||
|
run: npm ci
|
||
|
- name: Set up JDK 1.8
|
||
|
uses: actions/setup-java@v1
|
||
|
with:
|
||
|
java-version: 1.8
|
||
|
- name: Copy web assets to native platform
|
||
|
run: npx ionic capacitor copy android --no-build
|
||
|
- name: Update native platform
|
||
|
run: npx ionic capacitor update android
|
||
|
- name: Build with Gradle
|
||
|
working-directory: android
|
||
|
run: ./gradlew build
|
||
|
ios:
|
||
|
name: Build iOS platform
|
||
|
runs-on: macos-latest
|
||
|
needs: [build]
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Download artifacts
|
||
|
uses: actions/download-artifact@v2
|
||
|
with:
|
||
|
name: www
|
||
|
path: www
|
||
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||
|
uses: actions/setup-node@v2
|
||
|
with:
|
||
|
node-version: ${{ env.NODE_VERSION }}
|
||
|
- name: Install dependencies
|
||
|
run: npm ci
|
||
|
- name: Copy web assets to native platform
|
||
|
run: npx ionic capacitor copy ios --no-build
|
||
|
- name: Update native platform
|
||
|
run: npx ionic capacitor update ios
|
||
|
- name: Add empty `GoogleService-Info.plist`
|
||
|
run: echo "$GOOGLE_SERVICE_INFO_PLIST" > ios/App/App/GoogleService-Info.plist
|
||
|
env:
|
||
|
GOOGLE_SERVICE_INFO_PLIST: ${{secrets.GOOGLE_SERVICE_INFO_PLIST}}
|
||
|
- name: Build and archive with xcodebuild
|
||
|
working-directory: ios
|
||
|
run: xcodebuild
|
||
|
-workspace App/App.xcworkspace
|
||
|
-scheme App
|
||
|
-archivePath App/build/App.xarchive
|
||
|
clean build archive
|
||
|
CODE_SIGN_IDENTITY=""
|
||
|
CODE_SIGNING_REQUIRED=NO
|
||
|
CODE_SIGNING_ALLOWED="NO"
|
||
|
CODE_SIGN_ENTITLEMENTS=""
|
||
|
lint:
|
||
|
name: Lint
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||
|
uses: actions/setup-node@v2
|
||
|
with:
|
||
|
node-version: ${{ env.NODE_VERSION }}
|
||
|
- name: Install dependencies
|
||
|
run: npm ci
|
||
|
- name: Run ESLint and Prettier
|
||
|
run: npm run lint
|
||
|
test:
|
||
|
name: Test
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||
|
uses: actions/setup-node@v2
|
||
|
with:
|
||
|
node-version: ${{ env.NODE_VERSION }}
|
||
|
- name: Install dependencies
|
||
|
run: npm ci
|
||
|
- name: Run unit tests
|
||
|
run: npm run test:ci
|
||
|
e2e:
|
||
|
name: E2E
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
||
|
uses: actions/setup-node@v2
|
||
|
with:
|
||
|
node-version: ${{ env.NODE_VERSION }}
|
||
|
- name: Install dependencies
|
||
|
run: npm ci
|
||
|
- name: Run end-to-end tests
|
||
|
run: npm run e2e:ci
|