Skip to content

Commit

Permalink
Merge pull request #614 from yamadapc/issue/flutter-upgrade
Browse files Browse the repository at this point in the history
[Simple Metronome] Flutter upgrades & Rust bridge upgrade to v2
  • Loading branch information
yamadapc authored Aug 25, 2024
2 parents dddb4e3 + cefa187 commit 2143b7d
Show file tree
Hide file tree
Showing 375 changed files with 13,496 additions and 14,479 deletions.
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]

[target.aarch64-unknown-linux-gnu]
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]

[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld"]
33 changes: 29 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/rust
{
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
"ghcr.io/devcontainers/features/rust:1": {}
}
"name": "Rust",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye",

// Use 'mounts' to make the cargo cache persistent in a Docker Volume.
// "mounts": [
// {
// "source": "devcontainer-cargo-cache-${devcontainerId}",
// "target": "/usr/local/cargo",
// "type": "volume"
// }
// ]

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "./scripts/install-ubuntu-dependencies.sh && sudo apt install git-lfs"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
59 changes: 59 additions & 0 deletions .github/actions/common/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Common job setup
description: Install dependencies for running jobs

inputs:
cache_key:
description: 'A cache key for this step'
required: true
default: 'shared_cache'

runs:
using: composite
steps:
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ inputs.cache_key }}
cache-all-crates: true
cache-on-failure: true
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
flutter-version: 3.24.0
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
with:
version: "v0.4.0"
- name: Cache cargo binaries
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
key: ${{ runner.os }}-cargo-bin
- name: Install LLVM
shell: bash
if: runner.os == 'macOS'
run: brew install llvm
- name: Install dependencies
shell: bash
if: runner.os == 'Linux'
run: |
./scripts/install-ubuntu-apt-dependencies.sh
- uses: taiki-e/install-action@v2
with:
tool: cargo-tarpaulin,cargo-nextest,cargo-about
- name: Remove unused tools to reclaim disk space
shell: bash
if: runner.os == 'Linux'
run: |
sudo rm -rf \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for more information:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://containers.dev/guide/dependabot

version: 2
updates:
- package-ecosystem: "devcontainers"
directory: "/"
schedule:
interval: weekly
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI builds

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
rust:
uses: ./.github/workflows/rust.yml

dart:
uses: ./.github/workflows/dart.yml

web:
uses: ./.github/workflows/web.yml
37 changes: 6 additions & 31 deletions .github/workflows/dart.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,9 @@
name: Dart

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:

jobs:
build:
name: DAW - Dart - Build & test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- 'crates/apps/daw/**'
- uses: subosito/flutter-action@v1
if: steps.changes.outputs.src == 'true'
- name: Install dependencies
run: cd ./crates/apps/daw && flutter pub get
if: steps.changes.outputs.src == 'true'
- name: Verify formatting
run: cd ./crates/apps/daw && dart format --output=none --set-exit-if-changed .
if: steps.changes.outputs.src == 'true'
- name: Analyze project source
run: cd ./crates/apps/daw && flutter analyze
if: steps.changes.outputs.src == 'true'
- name: Run tests
run: cd ./crates/apps/daw && flutter test
if: steps.changes.outputs.src == 'true'

build_metronome:
name: Metronome - Dart - Build & test
runs-on: macos-12
Expand All @@ -47,7 +18,11 @@ jobs:
filters: |
src:
- 'crates/apps/metronome/**'
- uses: subosito/flutter-action@v1
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
flutter-version: 3.24.0
if: steps.changes.outputs.src == 'true'
- name: Install dependencies
run: cd ./crates/apps/metronome && flutter pub get
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/dart_web_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Dart Web

on:
push:
branches: [ master ]
workflow_call:

jobs:
build-web:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-cache-macos-docs"
cache-all-crates: true
cache-on-failure: true
- name: Build documentation
run: cargo doc --no-deps
env:
Expand Down
42 changes: 37 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Linux

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -37,19 +34,52 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-cache-linux3"
cache-all-crates: true
cache-on-failure: true

- name: Install dependencies
run: |
./scripts/install-ubuntu-apt-dependencies.sh
./scripts/install-ubuntu-rust-dependencies.sh
- name: Test
if: true
run: |
cargo test --workflow \
--exclude assert-no-alloc \
--exclude augmented-ui \
--exclude audiounit \
--exclude basedrop \
--exclude midir \
--exclude gfx \
--exclude iced \
--exclude iced-baseview \
--exclude iced_audio \
--exclude libloading \
--exclude lyon \
--exclude pathfinder \
--exclude piet \
--exclude plotters \
--exclude skribo \
--exclude vst \
--exclude example-iced-xcode-integration \
--exclude avfaudio-sys \
--exclude recording_buddy \
--exclude augmented-audio-knob \
--exclude augmented-audio-gui-basics \
--exclude darwin-webkit \
--exclude webview-holder \
--exclude visualisation_ \
--exclude macos-bundle-resources
- name: Test with coverage
if: false
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
COVERAGE_BOT_URL: ${{ secrets.COVERAGE_BOT_URL }}
COVERAGE_BOT_TOKEN: ${{ secrets.COVERAGE_BOT_TOKEN }}
run: |
cargo tarpaulin --skip-clean --workspace \
--engine llvm \
--features story \
--coveralls $COVERALLS_TOKEN \
--out lcov \
Expand Down Expand Up @@ -128,6 +158,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-cache-linux3"
cache-all-crates: true
cache-on-failure: true

- name: Install dependencies
run: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/linux_container.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Linux in Docker

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_call:

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -40,6 +37,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-cache-linux3"
cache-all-crates: true
cache-on-failure: true

- run: echo "/root/.cargo/bin" >> $GITHUB_PATH
- name: Test with coverage
Expand Down Expand Up @@ -127,6 +126,8 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
shared-key: "rust-cache-linux3"
cache-all-crates: true
cache-on-failure: true

- name: Build release
shell: bash
Expand Down
Loading

0 comments on commit 2143b7d

Please sign in to comment.