From ad67fbf39f75a55aec25685aea3f5a109829994d Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Fri, 29 Dec 2023 15:08:01 +0100 Subject: [PATCH 1/4] Improve CI --- .github/workflows/CI.yaml | 10 ++++++++-- Makefile | 10 ++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index e8f7c2cd6..8c08e5ac8 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -6,7 +6,7 @@ on: jobs: CI: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: @@ -27,6 +27,12 @@ jobs: uses: actions/cache@v3 with: path: ~/.local/share/flatpak - key: 45 + key: ${{ runner.os }}-flatpak-dependencies + + - name: Cache flatpak-builder + uses: actions/cache@v3 + with: + path: .flatpak-builder + key: ${{ runner.os }}-flatpak-builder - run: make ci diff --git a/Makefile b/Makefile index a6071fe6b..2de2379fd 100644 --- a/Makefile +++ b/Makefile @@ -6,19 +6,17 @@ setup: flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo flatpak install --or-update --user --noninteractive flathub org.gnome.Sdk//45 org.flatpak.Builder org.freedesktop.Sdk.Extension.rust-stable//23.08 org.freedesktop.Sdk.Extension.vala//23.08 org.freedesktop.Sdk.Extension.llvm16//23.08 npm install - flatpak-builder --ccache --force-clean --stop-at=gst-plugin-gtk4 flatpak build-aux/re.sonny.Workbench.Devel.json + flatpak-builder --delete-build-dirs --disable-updates --build-only --ccache --force-clean --stop-at=gst-plugin-gtk4 flatpak build-aux/re.sonny.Workbench.Devel.json lint: # JavaScript ./node_modules/.bin/eslint --max-warnings=0 src -# rustfmt +# Rust ./build-aux/fun rustfmt --check --edition 2021 src/**/*.rs -# black +# Python ./build-aux/fun black --check src/**/*.py -# gettext -# find po/ -type f -name "*po" -print0 | xargs -0 -n1 ./build-aux/fun msgfmt -o /dev/null --check # Blueprint - find src/ -type f -name "*blp" -print0 | xargs -0 ./build-aux/fun blueprint-compiler format + ./build-aux/fun blueprint-compiler format src/**/*.blp # Flatpak manifests flatpak run --user --command=flatpak-builder-lint org.flatpak.Builder manifest --exceptions build-aux/re.sonny.Workbench.json flatpak run --user --command=flatpak-builder-lint org.flatpak.Builder manifest --exceptions build-aux/re.sonny.Workbench.Devel.json From d9f198b53baf0ca4fd30d3bd390679357b02d38d Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Fri, 29 Dec 2023 15:25:05 +0100 Subject: [PATCH 2/4] always save cache --- .github/workflows/CI.yaml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 8c08e5ac8..32522ed42 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -23,16 +23,30 @@ jobs: packages: flatpak flatpak-builder version: 1.0 - - name: Cache Flatpak dependencies - uses: actions/cache@v3 + # Restore caches + - name: Restore Flatpak dependencies + uses: actions/cache/restore@v3 with: path: ~/.local/share/flatpak key: ${{ runner.os }}-flatpak-dependencies - - - name: Cache flatpak-builder - uses: actions/cache@v3 + - name: Restore .flatpak-builder + uses: actions/cache/restore@v3 with: path: .flatpak-builder key: ${{ runner.os }}-flatpak-builder - run: make ci + + # Save caches + - name: Save Flatpak dependencies + uses: actions/cache/save@v3 + if: always() + with: + path: ~/.local/share/flatpak + key: ${{ runner.os }}-flatpak-dependencies + - name: Save .flatpak-builder + uses: actions/cache/save@v3 + if: always() + with: + path: .flatpak-builder + key: ${{ runner.os }}-flatpak-builder From 66c5fb46643af5274dd8e3608d23b322e9323c1a Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Fri, 29 Dec 2023 16:07:48 +0100 Subject: [PATCH 3/4] fix cache key --- .github/workflows/CI.yaml | 11 +++++++---- Makefile | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 32522ed42..d2a402ba3 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -28,12 +28,12 @@ jobs: uses: actions/cache/restore@v3 with: path: ~/.local/share/flatpak - key: ${{ runner.os }}-flatpak-dependencies + key: ${{ runner.os }}-flatpak-dependencies-${{ github.run_id }} - name: Restore .flatpak-builder uses: actions/cache/restore@v3 with: path: .flatpak-builder - key: ${{ runner.os }}-flatpak-builder + key: ${{ runner.os }}-flatpak-builder-${{ github.run_id }} - run: make ci @@ -43,10 +43,13 @@ jobs: if: always() with: path: ~/.local/share/flatpak - key: ${{ runner.os }}-flatpak-dependencies + key: ${{ runner.os }}-flatpak-dependencies-${{ github.run_id }} + restore-keys: ${{ runner.os }}-flatpak-dependencies- + - name: Save .flatpak-builder uses: actions/cache/save@v3 if: always() with: path: .flatpak-builder - key: ${{ runner.os }}-flatpak-builder + key: ${{ runner.os }}-flatpak-builder-${{ github.run_id }} + restore-keys: ${{ runner.os }}-flatpak-builder- diff --git a/Makefile b/Makefile index 2de2379fd..e7d70712d 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ setup: flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo flatpak install --or-update --user --noninteractive flathub org.gnome.Sdk//45 org.flatpak.Builder org.freedesktop.Sdk.Extension.rust-stable//23.08 org.freedesktop.Sdk.Extension.vala//23.08 org.freedesktop.Sdk.Extension.llvm16//23.08 npm install - flatpak-builder --delete-build-dirs --disable-updates --build-only --ccache --force-clean --stop-at=gst-plugin-gtk4 flatpak build-aux/re.sonny.Workbench.Devel.json + flatpak-builder --delete-build-dirs --disable-updates --build-only --ccache --force-clean --stop-at=Workbench flatpak build-aux/re.sonny.Workbench.Devel.json lint: # JavaScript @@ -37,7 +37,7 @@ unit: test: unit lint ci: setup unit lint - flatpak-builder --ccache --force-clean flatpak build-aux/re.sonny.Workbench.Devel.json + flatpak-builder --delete-build-dirs --disable-updates --build-only --ccache --force-clean flatpak build-aux/re.sonny.Workbench.Devel.json # Note that if you have Sdk extensions installed they will be used # make sure to test without the sdk extensions installed From 34b1ac3635a039465697d0cce61c8dcdeff5036a Mon Sep 17 00:00:00 2001 From: Sonny Piers Date: Fri, 29 Dec 2023 16:17:59 +0100 Subject: [PATCH 4/4] f --- .github/workflows/CI.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index d2a402ba3..fbaf37c56 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -29,11 +29,13 @@ jobs: with: path: ~/.local/share/flatpak key: ${{ runner.os }}-flatpak-dependencies-${{ github.run_id }} + restore-keys: ${{ runner.os }}-flatpak-dependencies- - name: Restore .flatpak-builder uses: actions/cache/restore@v3 with: path: .flatpak-builder key: ${{ runner.os }}-flatpak-builder-${{ github.run_id }} + restore-keys: ${{ runner.os }}-flatpak-builder- - run: make ci @@ -44,12 +46,9 @@ jobs: with: path: ~/.local/share/flatpak key: ${{ runner.os }}-flatpak-dependencies-${{ github.run_id }} - restore-keys: ${{ runner.os }}-flatpak-dependencies- - - name: Save .flatpak-builder uses: actions/cache/save@v3 if: always() with: path: .flatpak-builder key: ${{ runner.os }}-flatpak-builder-${{ github.run_id }} - restore-keys: ${{ runner.os }}-flatpak-builder-