Skip to content
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
4 changes: 4 additions & 0 deletions .fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"flutter": "3.3.2",
"flavors": {}
}
13 changes: 13 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Setup Flutter environment and get dependencies

runs:
using: "composite"
steps:
- name: Install Flutter
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
- name: Get dependencies
shell: bash
run: flutter pub get
- name: Generate intermediates
shell: bash
run: flutter pub run build_runner build --delete-conflicting-outputs
15 changes: 15 additions & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Run Flutter Analyze

on:
workflow_call:

jobs:
analyze:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Flutter
uses: ./.github/actions/setup
- name: Analyze
run: flutter analyze
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Artifacts

on:
workflow_call:
inputs:
platform:
required: true
type: string

jobs:
build:
runs-on: ${{ inputs.platform == 'linux' && 'ubuntu-latest' || inputs.platform == 'windows' && 'windows-latest' || inputs.platform == 'macos' && 'macos-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install dependencies
if: ${{ inputs.platform == 'linux' }}
run: |
sudo apt-get update -y
sudo apt-get install \
clang cmake git \
ninja-build pkg-config \
libgtk-3-dev liblzma-dev \
libstdc++-12-dev
- name: Setup Flutter
uses: ./.github/actions/setup
- name: Build Artifacts
working-directory: example/${{ inputs.platform }}
run: flutter build ${{ inputs.platform }} --release
41 changes: 41 additions & 0 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Pipeline

on:
pull_request:
push:

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

jobs:
analyze:
name: Analyze
uses: ./.github/workflows/analyze.yml

test:
name: Testing
uses: ./.github/workflows/test.yml
strategy:
matrix:
platform: [ linux, windows, macos ]
with:
platform: ${{ matrix.platform }}

build:
name: Build ${{ matrix.platform }}
needs:
- analyze
- test
uses: ./.github/workflows/build.yml
strategy:
matrix:
platform: [ linux, windows, macos ]
with:
platform: ${{ matrix.platform }}

publish:
name: Publish
needs:
- build
uses: ./.github/workflows/publish.yml
51 changes: 0 additions & 51 deletions .github/workflows/main.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Publish Artifacts

on:
workflow_call:

jobs:
publish:
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
19 changes: 19 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run Flutter Tests

on:
workflow_call:
inputs:
platform:
required: true
type: string

jobs:
test:
runs-on: ${{ inputs.platform == 'linux' && 'ubuntu-latest' || inputs.platform == 'windows' && 'windows-latest' || inputs.platform == 'macos' && 'macos-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Flutter
uses: ./.github/actions/setup
- name: Run Tests
run: flutter test test/${{ inputs.platform }}/disks_test.dart
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Disks Desktop is Flutter desktop library able to retrieve the installed devices information

[![Pub](https://img.shields.io/pub/v/disks_desktop.svg)](https://pub.dev/packages/disks_desktop)
![Flutter CI](https://github.com/AngeloAvv/disks/workflows/Flutter%20CI/badge.svg)
![Flutter CI](https://github.com/AngeloAvv/disks/workflows/Pipeline/badge.svg)
[![Star on GitHub](https://img.shields.io/github/stars/AngeloAvv/disks.svg?style=flat&logo=github&colorB=deeppink&label=stars)](https://github.com/AngeloAvv/disks)
[![License: MIT](https://img.shields.io/badge/license-MIT-purple.svg)](https://opensource.org/licenses/MIT)

Expand Down
Loading