Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ci #526

Merged
merged 13 commits into from
Nov 22, 2024
107 changes: 17 additions & 90 deletions .github/workflows/alpha_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,98 +3,25 @@ name: '🧪 and 📢 and 📲'
on:
push:
branches: ['main']

jobs:
tests:
runs-on: ubuntu-latest
environment: test
steps:
- uses: actions/checkout@v4
- uses: dyne/pnpm@main
with:
node-version: '20.11.1'
submodules: true
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- uses: supplypike/setup-bin@v4
with:
uri: https://github.com/dyne/zenroom/releases/latest/download/zencode-exec
name: zencode-exec
version: latest
- run: |
git clone --recursive https://github.com/forkbombeu/signroom
cd signroom/admin
mkdir pb_data
cp ../../tests/fixtures/test.db pb_data/data.db
rm pb_migrations/1685000000_seed_features.js
go build
./pb migrate
./pb serve &
- run: npx playwright install --with-deps
- run: pnpm test:integration --workers 1
env:
PUBLIC_BACKEND_URL: http://localhost:8090
USER_EMAIL: ${{ vars.USER_EMAIL }}
USER_PASSWORD: ${{ vars.USER_PASSWORD }}
USER_SEED: ${{ vars.USER_SEED }}
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results
path: test-results/
retention-days: 10
uses: ./.github/workflows/test.yml
with:
backend-url: http://localhost:8090
user-email: ${{ vars.USER_EMAIL }}
user-password: ${{ vars.USER_PASSWORD }}
user-seed: ${{ vars.USER_SEED }}

distribute:
runs-on: ubuntu-latest
environment: test
uses: ./.github/workflows/distribute.yml
needs: tests
steps:
- uses: dyne/pnpm@main
with:
submodules: true
node-version: '20.11.1'
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: playstore_keystore
with:
fileName: android_keystore.keystore
encodedString: ${{ secrets.BUNDLE_BETA_PLAYSTORE }}
- name: Decode Service Account File for Firebase
uses: timheuer/base64-to-file@v1
id: service_account
with:
fileName: play-store-credentials.json
encodedString: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
- name: Decode Service Account File for PlayStore
uses: timheuer/base64-to-file@v1
id: play_console_account
with:
fileName: play-store-credentials.json
encodedString: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: maierj/[email protected]
env:
KEYSTORE_PATH: ${{ steps.playstore_keystore.outputs.filePath }}
SERVICE_ACCOUNT_PATH: ${{ steps.play_console_account.outputs.filePath }}
KEYSTORE_KEY_ALIAS: ${{ secrets.BUNDLE_BETA_PLAYSTORE_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.BUNDLE_BETA_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.BUNDLE_BETA_PASSWORD }}
PUBLIC_BACKEND_URL: ${{ vars.PUBLIC_BACKEND_URL }}
with:
lane: alpha
with:
backend-url: ${{ vars.PUBLIC_BACKEND_URL }}
lane: alpha
secrets:
keystore-file: ${{ secrets.BUNDLE_BETA_PLAYSTORE }}
service-account: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
keystore-alias: ${{ secrets.BUNDLE_BETA_PLAYSTORE_ALIAS }}
keystore-password: ${{ secrets.BUNDLE_BETA_PASSWORD }}
keystore-key-password: ${{ secrets.BUNDLE_BETA_PASSWORD }}
107 changes: 18 additions & 89 deletions .github/workflows/beta_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,97 +2,26 @@ name: 'publish beta'

on:
workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest
environment: test
steps:
- uses: actions/checkout@v4
- uses: dyne/pnpm@main
with:
node-version: '20.11.1'
submodules: true
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- uses: supplypike/setup-bin@v4
with:
uri: https://github.com/dyne/zenroom/releases/latest/download/zencode-exec
name: zencode-exec
version: latest
- run: |
git clone --recursive https://github.com/forkbombeu/signroom
cd signroom/admin
mkdir pb_data
cp ../../tests/fixtures/test.db pb_data/data.db
rm pb_migrations/1685000000_seed_features.js
go build
./pb migrate
./pb serve &
- run: npx playwright install --with-deps
- run: pnpm test:integration --workers 1
env:
PUBLIC_BACKEND_URL: http://localhost:8090
USER_EMAIL: ${{ vars.USER_EMAIL }}
USER_PASSWORD: ${{ vars.USER_PASSWORD }}
USER_SEED: ${{ vars.USER_SEED }}
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: test-results
path: test-results/
retention-days: 10
uses: ./.github/workflows/test.yml
with:
backend-url: http://localhost:8090
user-email: ${{ vars.USER_EMAIL }}
user-password: ${{ vars.USER_PASSWORD }}
user-seed: ${{ vars.USER_SEED }}

distribute:
runs-on: ubuntu-latest
uses: ./.github/workflows/distribute.yml
needs: tests
steps:
- uses: dyne/pnpm@main
with:
submodules: true
node-version: '20.11.1'
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: playstore_keystore
with:
fileName: android_keystore.keystore
encodedString: ${{ secrets.BUNDLE_BETA_PLAYSTORE }}
- name: Decode Service Account File for Firebase
uses: timheuer/base64-to-file@v1
id: service_account
with:
fileName: play-store-credentials.json
encodedString: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
- name: Decode Service Account File for PlayStore
uses: timheuer/base64-to-file@v1
id: play_console_account
with:
fileName: play-store-credentials.json
encodedString: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: maierj/[email protected]
env:
KEYSTORE_PATH: ${{ steps.playstore_keystore.outputs.filePath }}
SERVICE_ACCOUNT_PATH: ${{ steps.play_console_account.outputs.filePath }}
KEYSTORE_KEY_ALIAS: ${{ secrets.BUNDLE_BETA_PLAYSTORE_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.BUNDLE_BETA_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.BUNDLE_BETA_PASSWORD }}
PUBLIC_BACKEND_URL: ${{ vars.PUBLIC_BACKEND_URL }}
with:
lane: beta
with:
backend-url: ${{ vars.PUBLIC_BACKEND_URL }}
lane: beta
secrets:
keystore-file: ${{ secrets.BUNDLE_BETA_PLAYSTORE }}
service-account: ${{ secrets.PLAYSTORE_SERVICE_ACCOUNT }}
keystore-alias: ${{ secrets.BUNDLE_BETA_PLAYSTORE_ALIAS }}
keystore-password: ${{ secrets.BUNDLE_BETA_PASSWORD }}
keystore-key-password: ${{ secrets.BUNDLE_BETA_PASSWORD }}

77 changes: 77 additions & 0 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# .github/workflows/distribute.yml
name: Reusable Distribute Workflow

on:
workflow_call:
inputs:
backend-url:
required: true
type: string
lane:
required: true
type: string
secrets:
keystore-file:
required: true
service-account:
required: true
keystore-alias:
required: true
keystore-key-password:
required: true
keystore-password:
required: true
firebase-app-id:
required: false

jobs:
distribute:
runs-on: ubuntu-latest
steps:
- uses: dyne/pnpm@main
with:
submodules: true
node-version: '20.11.1'
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: keystore
with:
fileName: keystore.keystore
encodedString: ${{ secrets.keystore-file }}
- name: Decode Service Account File
uses: timheuer/base64-to-file@v1
id: service_account
with:
fileName: service-account.json
encodedString: ${{ secrets.service-account }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- uses: maierj/[email protected]
env:
KEYSTORE_PATH: ${{ steps.keystore.outputs.filePath }}
SERVICE_ACCOUNT_PATH: ${{ steps.service_account.outputs.filePath }}
KEYSTORE_KEY_ALIAS: ${{ secrets.keystore-alias }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.keystore-key-password }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.keystore-password }}
PUBLIC_BACKEND_URL: ${{ inputs.backend-url }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}
PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
FIREBASE_APP_ID: ${{ secrets.firebase-app-id }}

with:
lane: ${{ inputs.lane }}
Loading
Loading