Skip to content

Commit

Permalink
Remove project specific Docker environment
Browse files Browse the repository at this point in the history
  • Loading branch information
chrgernoe committed Apr 12, 2023
1 parent 49ee4e9 commit 4461333
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 684 deletions.
130 changes: 106 additions & 24 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,115 @@
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
# Used GitHub actions:
# * https://github.com/marketplace/actions/checkout
# * https://github.com/marketplace/actions/cache
# * https://github.com/marketplace/actions/setup-java-jdk
# * https://github.com/marketplace/actions/gradle-build-action
# * https://github.com/marketplace/actions/android-emulator-runner

name: CI
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- dev-[0-9]+
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'dev-[0-9]+'
paths-ignore:
- 'docs/**'
pull_request:
branches:
- master
paths-ignore:
- 'docs/**'
workflow_dispatch:
inputs:
test_deploy:
description: 'Build app release but skip actual deploy process'
type: boolean
default: false
skip_tests:
description: 'Skip actual test runs'
type: boolean
default: false
jobs:
test-build-deploy:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Run tests
if: ${{ !inputs.skip_tests }}
run: ./gradlew test --stacktrace
instrumentation-tests:
runs-on: macos-latest
strategy:
matrix:
include:
- api-level: 26
arch: x86
target: default
- api-level: 33
arch: x86_64
target: google_apis
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK environment
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: ${{ matrix.target }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Run tests
if: ${{ !inputs.skip_tests }}
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ matrix.arch }}
target: ${{ matrix.target }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedCheck
build-deploy:
if: ${{ github.ref_type == 'tag' || inputs.test_deploy }}
runs-on: ubuntu-latest
needs: [unit-tests, instrumentation-tests]
steps:
- name: Check-out repository
uses: actions/checkout@v2
- name: Set up Python Environment
uses: actions/setup-python@v2
uses: actions/checkout@v3
- name: Set up JDK environment
uses: actions/setup-java@v3
with:
python-version: '3.10'
- name: Install Python Packages
run: pip install -r requirements.txt
- name: Prepare App Environment
distribution: temurin
java-version: 11
- name: Prepare app environment
run: |
# Decode Google Service Account JSON file
echo ${{ secrets.PLAY_SERVICES_FILE_BASE64 }} | base64 -d > ${{ secrets.PLAY_SERVICES_FILE }}
Expand All @@ -34,17 +118,15 @@ jobs:
# Write keystore properties file
printf 'storeFile=%s\nstorePassword=%s\nkeyAlias=%s\nkeyPassword=%s\nplayServicesFile=%s\n' \
${{ secrets.PLAY_KEY_STORE }} ${{ secrets.PLAY_STORE_PASSWORD }} ${{ secrets.PLAY_KEY_ALIAS }} ${{ secrets.PLAY_KEY_PASSWORD }} ${{ secrets.PLAY_SERVICES_FILE }} > keystore.properties
- name: Start Docker Container
run: scripts/make docker --start-new
- name: Run Tests
run: scripts/make tests
- name: Build Distributions
run: scripts/make dists
- name: Deploy Development Release
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'dev-') }}
run: scripts/make deploy --type dev
- name: Deploy Stable Release
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
run: scripts/make deploy --type stable
- name: Stop Docker Container
run: scripts/make docker --stop
- name: Build development release
if: ${{ startsWith(github.ref_name, 'dev-') || inputs.test_deploy }}
run: ./gradlew bundleDevRelease
- name: Deploy development release
if: ${{ startsWith(github.ref_name, 'dev-') && !inputs.test_deploy }}
run: ./gradlew publishDevReleaseBundle
- name: Build stable release
if: ${{ startsWith(github.ref_name, 'v') || inputs.test_deploy }}
run: ./gradlew bundleStableRelease
- name: Deploy stable release
if: ${{ startsWith(github.ref_name, 'v') && !inputs.test_deploy }}
run: ./gradlew publishStableReleaseBundle
70 changes: 0 additions & 70 deletions .github/workflows/instrumentation-tests.yml

This file was deleted.

12 changes: 12 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://hub.docker.com/_/ruby/
FROM ruby:3.2

# Throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1

WORKDIR /usr/src/app

COPY Gemfile Gemfile.lock ./
RUN bundle install

COPY . .
71 changes: 40 additions & 31 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.1.7)
em-websocket (0.5.1)
concurrent-ruby (1.2.2)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.13.1)
ffi (1.15.5)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.5)
google-protobuf (3.22.2)
google-protobuf (3.22.2-x86_64-linux)
http_parser.rb (0.8.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (4.1.1)
jekyll (4.3.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.1)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (~> 3.0)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (~> 1.8)
jekyll-feed (0.15.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-feed (0.17.0)
jekyll (>= 3.7, < 5.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.6.1)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.1)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.1)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
Expand All @@ -54,26 +57,32 @@ GEM
jekyll-seo-tag (~> 2.1)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rb-fsevent (0.10.4)
public_suffix (5.0.1)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.21.0)
rouge (4.1.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)
sass-embedded (1.61.0)
google-protobuf (~> 3.21)
rake (>= 10.0.0)
sass-embedded (1.61.0-x86_64-linux-gnu)
google-protobuf (~> 3.21)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.4.2)
webrick (1.8.1)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
jekyll
jekyll-redirect-from
minima

BUNDLED WITH
2.2.5
2.4.10
5 changes: 2 additions & 3 deletions docs/app-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ necessary:
These files must **not** be committed and are provided by the CI for
Google Play deployment.

To build the app bundle inside the Docker environment, run the
command
To build all app bundles, run command

```shell
scripts/make dists
./gradlew bundleRelease
```

which builds both, the `dev` and `stable` release which are than
Expand Down
Loading

0 comments on commit 4461333

Please sign in to comment.