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

[CI] Implement SonarCloud #1275

Merged
merged 4 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/actions/enable-kvm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Enable KVM'
description: 'Enables hardware accelerated Android virtualization on Actions Linux larger hosted runners'
runs:
using: "composite"
steps:
- name: Enable KVM group perms
shell: bash
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
13 changes: 13 additions & 0 deletions .github/actions/gradle-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Gradle Cache'
description: 'Cache Gradle Build Cache to improve workflow execution time'
runs:
using: "composite"
steps:
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
10 changes: 10 additions & 0 deletions .github/actions/setup-java/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Setup Java'
description: 'Setup Java'
runs:
using: "composite"
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 17
9 changes: 9 additions & 0 deletions .github/actions/setup-ruby/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Setup Ruby'
description: 'Setup Ruby and cache bundler'
runs:
using: "composite"
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
74 changes: 28 additions & 46 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@ name: Android CI
on:
push:
branches: [ main ]

pull_request:
branches:
- '**'

workflow_dispatch:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

env:
BUILD_CACHE_AWS_REGION: ${{ secrets.BUILD_CACHE_AWS_REGION }}
BUILD_CACHE_AWS_BUCKET: ${{ secrets.BUILD_CACHE_AWS_BUCKET }}
BUILD_CACHE_AWS_ACCESS_KEY_ID: ${{ secrets.BUILD_CACHE_AWS_ACCESS_KEY_ID }}
BUILD_CACHE_AWS_SECRET_KEY: ${{ secrets.BUILD_CACHE_AWS_SECRET_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}

jobs:
lint:
Expand All @@ -20,11 +29,7 @@ jobs:
steps:
- name: Check out code
uses: actions/[email protected]
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java
- name: spotless
run: ./gradlew spotlessCheck --scan

Expand All @@ -34,11 +39,7 @@ jobs:
steps:
- name: Check out code
uses: actions/[email protected]
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java
- name: API check
run: ./gradlew apiCheck --scan

Expand All @@ -47,21 +48,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: set up JDK
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java

- name: Cache Gradle and wrapper
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: ./.github/actions/gradle-cache

- name: Make Gradle executable
run: chmod +x ./gradlew
Expand All @@ -79,26 +68,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: set up JDK
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java

- name: Cache Gradle and wrapper
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: ./.github/actions/gradle-cache

- name: Run unit tests
run: |
./gradlew :stream-video-android-ui-compose:testDebugUnitTest --scan --stacktrace
./gradlew :stream-video-android-core:testDebugUnitTest --scan --stacktrace
./gradlew :stream-video-android-ui-compose:koverXmlReport --scan --stacktrace
./gradlew :stream-video-android-core:koverXmlReport --scan --stacktrace

- name: Unit tests core results
uses: actions/upload-artifact@v4
Expand All @@ -112,21 +89,26 @@ jobs:
name: unit-tests-compose-results
path: stream-video-android-ui-compose/build/reports/tests/testDebugUnitTest/index.html

- uses: ./.github/actions/setup-ruby

- name: Sonar
run: bundle exec fastlane run_sonar_analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

androidTest-GMD:
name: Android Test with GMD
if: ${{ false }} # disable for now
runs-on: macOS-latest
runs-on: ubuntu-latest
timeout-minutes: 55

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- uses: ./.github/actions/setup-java

- uses: ./.github/actions/enable-kvm

# Sets gradle up
- name: Setup Gradle
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/app-distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java
- name: Prepare environment
run: |
echo "${{ secrets.RELEASE_KEYSTORE }}" > .sign/release.keystore.asc
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/artifact-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java

- name: Prepare environment
run: |
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/internal-app-distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java
- name: Prepare environment
run: |
echo "${{ secrets.RELEASE_KEYSTORE }}" > .sign/release.keystore.asc
Expand Down
8 changes: 2 additions & 6 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- develop
workflow_dispatch:

jobs:
publish:
name: Snapshot build and publish
Expand All @@ -14,11 +14,7 @@ jobs:
- name: Check out code
uses: actions/[email protected]

- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java

- name: Release build
# assembleRelease for all modules, excluding non-library modules: samples, docs
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ jobs:
# with:
# ref: release

- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java

- name: Release build
# assembleRelease for all modules, excluding non-library modules: samples, docs
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/release-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ jobs:
uses: actions/[email protected]
with:
ref: main
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: adopt
java-version: 17
- uses: ./.github/actions/setup-java
- name: Generate Dokka HTML docs
run: ./gradlew dokkaHtmlMultimodule
- name: Deploy to GitHub pages
Expand Down
24 changes: 24 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# frozen_string_literal: true

source 'https://rubygems.org'

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

gem 'fastlane', '2.225.0'
gem 'json'
gem 'rubocop', '1.38', group: :rubocop_dependencies
gem 'sinatra', group: :sinatra_dependencies

eval_gemfile('fastlane/Pluginfile')

group :rubocop_dependencies do
gem 'rubocop-performance'
gem 'rubocop-require_tools'
end

group :sinatra_dependencies do
gem 'eventmachine'
gem 'faye-websocket'
gem 'puma'
gem 'rackup'
end
Loading
Loading