Skip to content

Commit 47cbd81

Browse files
authored
New build pipeline (#16)
* New build pipeline * Fixed naming * Generate intermediates * Fixed tests * Fixed test OS
1 parent b332fc1 commit 47cbd81

File tree

9 files changed

+133
-52
lines changed

9 files changed

+133
-52
lines changed

.fvmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"flutter": "3.3.2",
3+
"flavors": {}
4+
}

.github/actions/setup/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Setup Flutter environment and get dependencies
2+
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Install Flutter
7+
uses: kuhnroyal/flutter-fvm-config-action/setup@v3
8+
- name: Get dependencies
9+
shell: bash
10+
run: flutter pub get
11+
- name: Generate intermediates
12+
shell: bash
13+
run: flutter pub run build_runner build --delete-conflicting-outputs

.github/workflows/analyze.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Run Flutter Analyze
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
analyze:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v5
12+
- name: Setup Flutter
13+
uses: ./.github/actions/setup
14+
- name: Analyze
15+
run: flutter analyze

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build Artifacts
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
platform:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
build:
12+
runs-on: ${{ inputs.platform == 'linux' && 'ubuntu-latest' || inputs.platform == 'windows' && 'windows-latest' || inputs.platform == 'macos' && 'macos-latest' }}
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v5
16+
- name: Install dependencies
17+
if: ${{ inputs.platform == 'linux' }}
18+
run: |
19+
sudo apt-get update -y
20+
sudo apt-get install \
21+
clang cmake git \
22+
ninja-build pkg-config \
23+
libgtk-3-dev liblzma-dev \
24+
libstdc++-12-dev
25+
- name: Setup Flutter
26+
uses: ./.github/actions/setup
27+
- name: Build Artifacts
28+
working-directory: example/${{ inputs.platform }}
29+
run: flutter build ${{ inputs.platform }} --release

.github/workflows/default.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Pipeline
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
uses: ./.github/workflows/analyze.yml
15+
16+
test:
17+
name: Testing
18+
uses: ./.github/workflows/test.yml
19+
strategy:
20+
matrix:
21+
platform: [ linux, windows, macos ]
22+
with:
23+
platform: ${{ matrix.platform }}
24+
25+
build:
26+
name: Build ${{ matrix.platform }}
27+
needs:
28+
- analyze
29+
- test
30+
uses: ./.github/workflows/build.yml
31+
strategy:
32+
matrix:
33+
platform: [ linux, windows, macos ]
34+
with:
35+
platform: ${{ matrix.platform }}
36+
37+
publish:
38+
name: Publish
39+
needs:
40+
- build
41+
uses: ./.github/workflows/publish.yml

.github/workflows/main.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Publish Artifacts
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
publish:
8+
if: startsWith(github.ref, 'refs/tags/')
9+
permissions:
10+
id-token: write
11+
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Run Flutter Tests
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
platform:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
test:
12+
runs-on: ${{ inputs.platform == 'linux' && 'ubuntu-latest' || inputs.platform == 'windows' && 'windows-latest' || inputs.platform == 'macos' && 'macos-latest' }}
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v5
16+
- name: Setup Flutter
17+
uses: ./.github/actions/setup
18+
- name: Run Tests
19+
run: flutter test test/${{ inputs.platform }}/disks_test.dart

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Disks Desktop is Flutter desktop library able to retrieve the installed devices information
66

77
[![Pub](https://img.shields.io/pub/v/disks_desktop.svg)](https://pub.dev/packages/disks_desktop)
8-
![Flutter CI](https://github.com/AngeloAvv/disks/workflows/Flutter%20CI/badge.svg)
8+
![Flutter CI](https://github.com/AngeloAvv/disks/workflows/Pipeline/badge.svg)
99
[![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)
1010
[![License: MIT](https://img.shields.io/badge/license-MIT-purple.svg)](https://opensource.org/licenses/MIT)
1111

0 commit comments

Comments
 (0)