Skip to content

Commit

Permalink
refactor: enhance GitHub Actions workflow with improved job names for…
Browse files Browse the repository at this point in the history
… clarity
  • Loading branch information
khoren93 committed Dec 2, 2024
1 parent 046b650 commit 37b8ee1
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ permissions: read-all
jobs:
# Job for linting and formatting Dart code
lint:
name: "Lint and Format Dart Code"
runs-on: ubuntu-latest
steps:
# Checkout the repository
Expand All @@ -44,7 +45,7 @@ jobs:

# Build the example application across all supported platforms
build-example:
name: 'Build example (${matrix.target}, ${matrix.os})'
name: 'Build example (${{ matrix.target }}, ${{ matrix.os }})'
needs: lint
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 20
Expand Down Expand Up @@ -73,15 +74,15 @@ jobs:
run: ./scripts/update_ios_macos_src.sh

# Android-specific setup
- name: Setup Java for Android
- name: Setup Java for Android (${{ matrix.target }}, ${{ matrix.os }})'
if: matrix.target == 'android'
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin

# Linux-specific setup
- name: Install dependencies for Flutter on Linux
- name: Install dependencies for Flutter on Linux (${{ matrix.target }}, ${{ matrix.os }})'
if: matrix.target == 'linux' && matrix.os == 'ubuntu'
run: |
sudo apt update
Expand All @@ -102,7 +103,7 @@ jobs:
enforce-lockfile: true

# Build the example application
- name: Build example
- name: Build example for ${{ matrix.target }} on ${{ matrix.os }}
run: |
cd example
TARGET=${{ matrix.target }}
Expand All @@ -127,7 +128,7 @@ jobs:
# Integration tests for all platforms except Android (handled separately)
test-example:
name: 'Test example (${matrix.target}, ${matrix.os})'
name: 'Test example (${{ matrix.target }}, ${{ matrix.os }})'
needs: build-example
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 30
Expand Down Expand Up @@ -170,7 +171,7 @@ jobs:
enforce-lockfile: true

# Linux-specific dependencies
- name: Install dependencies for Flutter on Linux
- name: Install dependencies for Flutter on Linux (${{ matrix.target }}, ${{ matrix.os }})'
if: matrix.target == 'linux' && matrix.os == 'ubuntu'
run: |
sudo apt update
Expand All @@ -179,7 +180,7 @@ jobs:
pkg-config xvfb network-manager upower
# Launch iOS Simulator for iOS tests
- name: Launch iOS Simulator
- name: Launch iOS Simulator for ${{ matrix.target }}
if: matrix.target == 'ios'
run: |
simulator_id=$(xcrun simctl create iphone-zxing \
Expand All @@ -188,7 +189,7 @@ jobs:
xcrun simctl boot ${simulator_id}
# Run tests
- name: Run tests
- name: Run tests for ${{ matrix.target }} on ${{ matrix.os }}
run: |
cd ./example
if [ "${{ matrix.target }}" == "linux" ]; then
Expand All @@ -199,7 +200,7 @@ jobs:
# Integration tests on Android emulator
test-example-android:
name: 'Test example (Android API v${{ matrix.api-level }})'
name: 'Test example on Android API level ${{ matrix.api-level }} (${{ matrix.os }})'
needs: build-example
runs-on: ubuntu-latest
timeout-minutes: 30
Expand All @@ -212,7 +213,7 @@ jobs:
with:
submodules: recursive

- name: Setup Java for Android
- name: Setup Java for Android (${{ matrix.target }}, ${{ matrix.os }})'
uses: actions/setup-java@v4
with:
java-version: 11
Expand All @@ -231,14 +232,14 @@ jobs:
enforce-lockfile: true

# Enable KVM for Android emulators
- name: Enable KVM
- name: Enable KVM for Android emulators (${{ matrix.api-level }})'
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
# Create and run Android emulator
- name: Run tests on Android emulator
- name: Run tests on Android API level ${{ matrix.api-level }}
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
Expand Down

0 comments on commit 37b8ee1

Please sign in to comment.