From 33b575fbf8dc6c9f550144073323f492bc6c9c74 Mon Sep 17 00:00:00 2001 From: Julia Pitts Date: Wed, 17 Apr 2024 22:51:31 +0000 Subject: [PATCH 1/8] Add package validation workflow. --- .../workflows/test_package_installation.yml | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/test_package_installation.yml diff --git a/.github/workflows/test_package_installation.yml b/.github/workflows/test_package_installation.yml new file mode 100644 index 0000000..b7cb26e --- /dev/null +++ b/.github/workflows/test_package_installation.yml @@ -0,0 +1,72 @@ +name: Test package installation +description: Tests that the built .deb and .rpm packages can be installed on a subset of supported versions +on: + push: + branches: [master] + pull_request: + branches: [master] + workflow_dispatch: +jobs: + build-packages: + runs-on: ubuntu-latest + steps: + - name: Clone repo + uses: actions/checkout@v3 + - name: Build packages + run: ./build_packages.sh + - name: Upload Ubuntu packages + uses: actions/upload-artifact@v4 + with: + name: ubuntu_packages + path: build/ubuntu/pool/main + - name: Upload Debian packages + uses: actions/upload-artifact@v4 + with: + name: debian_packages + path: build/debian/pool/main + - name: Upload Fedora packages + uses: actions/upload-artifact@v4 + with: + name: fedora_packages + path: build/fedora/pool + + test_debs: + strategy: + matrix: + platform: + # Test on all Debian and Ubuntu LTS releases that have GTK 4+, plus prerelease + - distro: debian + version: bookworm + - distro: debian + version: sid + - distro: ubuntu + version: "24.04" + - distro: ubuntu + version: devel + runs-on: ubuntu-latest + container: + image: "${{ strategy.matrix.platform.distro }}:${{ strategy.matrix.platform.version }}" + env: + DEBIAN_FRONTEND: noninteractive + steps: + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: "${{ strategy.matrix.platform.distro }}_packages" + - name: Install packages + run: apt update && apt upgrade -y && apt install -y --fix-missing ./dropbox_*.*.*_amd64.deb + + test_rpm: + strategy: + matrix: + version: [latest, rawhide] + runs-on: ubuntu-latest + container: + image: "fedora:${{ strategy.matrix.version }}" + steps: + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: "fedora_packages" + - name: Install packages + run: dnf upgrade && dnf install ./nautilus-dropbox-*.*.*-*.*.x86_64.rpm From fc1f633ea7ac0bdab4f782db40599abb7e9f9dbe Mon Sep 17 00:00:00 2001 From: Julia Pitts Date: Wed, 17 Apr 2024 23:30:22 +0000 Subject: [PATCH 2/8] Move the package installation validation into the canary builds to catch package renames in beta distros. --- .github/workflows/canary.yml | 116 +++++++++++++----- .../workflows/test_package_installation.yml | 72 ----------- 2 files changed, 83 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/test_package_installation.yml diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index c7ee7e2..12848bc 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -8,15 +8,34 @@ on: - cron: "29 1 * * 1" workflow_dispatch: jobs: - ubuntu: + # Source builds are performed on the latest beta of each supported distro to + # make sure we catch any code issues as soon as possible. + validate-source-build: + strategy: + matrix: + - image: ubuntu:devel + deps-script: install-apt-deps.sh + codename: $VERSION_CODENAME + pretty-name: $NAME $VERSION + codenames: $UBUNTU_CODENAMES + - image: debian:sid + deps-script: install-apt-deps.sh + codename: $VERSION_CODENAME + pretty-name: $NAME $VERSION + codenames: $UBUNTU_CODENAMES + - image: fedora:rawhide + deps-script: install-rpm-deps.sh + codename: $VERSION_ID + pretty-name: Fedora $VERSION_ID + codenames: $FEDORA_CODENAMES runs-on: ubuntu-latest container: - image: ubuntu:devel + image: ${{ strategy.matrix.image }} steps: - name: Clone repo uses: actions/checkout@v3 - name: Install deps - run: ./install-apt-deps.sh + run: ./${{ strategy.matrix.deps-script }} - name: Test build run: ./autogen.sh && make && make install - name: Run tests @@ -25,42 +44,73 @@ jobs: run: | . ./distro-info.sh . /etc/os-release - ./check-distro-info-support.sh "$VERSION_CODENAME" "$NAME $VERSION" "$UBUNTU_CODENAMES" + ./check-distro-info-support.sh \ + "${{ strategy.matrix.codename }}" \ + "${{ strategy.matrix.pretty-name }}" \ + "${{ strategy.matrix.codenames }}" - debian: + build-packages: runs-on: ubuntu-latest - container: - image: debian:sid steps: - name: Clone repo uses: actions/checkout@v3 - - name: Install deps - run: ./install-apt-deps.sh - - name: Test build - run: ./autogen.sh && make && make install - - name: Run tests - run: python3 ./dropbox_test.py - - name: Check that latest OS version is supported - run: | - . ./distro-info.sh - . /etc/os-release - ./check-distro-info-support.sh "$VERSION_CODENAME" "$PRETTY_NAME" "$DEBIAN_CODENAMES" + - name: Build packages + run: ./build_packages.sh + - name: Upload Ubuntu packages + uses: actions/upload-artifact@v4 + with: + name: ubuntu_packages + path: build/ubuntu/pool/main + - name: Upload Debian packages + uses: actions/upload-artifact@v4 + with: + name: debian_packages + path: build/debian/pool/main + - name: Upload Fedora packages + uses: actions/upload-artifact@v4 + with: + name: fedora_packages + path: build/fedora/pool - fedora: + test_debs: + strategy: + matrix: + platform: + # Test on all Debian and Ubuntu LTS releases that have GTK 4+, plus + # prerelease to make sure there are no package dependency issues. + - distro: debian + version: bookworm + - distro: debian + version: sid + - distro: ubuntu + version: "24.04" + - distro: ubuntu + version: devel runs-on: ubuntu-latest container: - image: fedora:rawhide + image: "${{ strategy.matrix.platform.distro }}:${{ strategy.matrix.platform.version }}" + env: + DEBIAN_FRONTEND: noninteractive steps: - - name: Clone repo - uses: actions/checkout@v3 - - name: Install deps - run: ./install-rpm-deps.sh - - name: Test build - run: ./autogen.sh && make && make install - - name: Run tests - run: python3 ./dropbox_test.py - - name: Check that latest OS version is supported - run: | - . ./distro-info.sh - . /etc/os-release - ./check-distro-info-support.sh "$VERSION_ID" "Fedora $VERSION_ID" "$FEDORA_CODENAMES" + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: "${{ strategy.matrix.platform.distro }}_packages" + - name: Install packages + run: apt update && apt upgrade -y && apt install -y --fix-missing ./dropbox_*.*.*_amd64.deb + + test_rpm: + strategy: + matrix: + # Fedora doesn't have LTS releases, so just run on latest and rawhide. + version: [latest, rawhide] + runs-on: ubuntu-latest + container: + image: "fedora:${{ strategy.matrix.version }}" + steps: + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: "fedora_packages" + - name: Install packages + run: dnf upgrade && dnf install ./nautilus-dropbox-*.*.*-*.*.x86_64.rpm diff --git a/.github/workflows/test_package_installation.yml b/.github/workflows/test_package_installation.yml deleted file mode 100644 index b7cb26e..0000000 --- a/.github/workflows/test_package_installation.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Test package installation -description: Tests that the built .deb and .rpm packages can be installed on a subset of supported versions -on: - push: - branches: [master] - pull_request: - branches: [master] - workflow_dispatch: -jobs: - build-packages: - runs-on: ubuntu-latest - steps: - - name: Clone repo - uses: actions/checkout@v3 - - name: Build packages - run: ./build_packages.sh - - name: Upload Ubuntu packages - uses: actions/upload-artifact@v4 - with: - name: ubuntu_packages - path: build/ubuntu/pool/main - - name: Upload Debian packages - uses: actions/upload-artifact@v4 - with: - name: debian_packages - path: build/debian/pool/main - - name: Upload Fedora packages - uses: actions/upload-artifact@v4 - with: - name: fedora_packages - path: build/fedora/pool - - test_debs: - strategy: - matrix: - platform: - # Test on all Debian and Ubuntu LTS releases that have GTK 4+, plus prerelease - - distro: debian - version: bookworm - - distro: debian - version: sid - - distro: ubuntu - version: "24.04" - - distro: ubuntu - version: devel - runs-on: ubuntu-latest - container: - image: "${{ strategy.matrix.platform.distro }}:${{ strategy.matrix.platform.version }}" - env: - DEBIAN_FRONTEND: noninteractive - steps: - - name: Download packages - uses: actions/download-artifact@v4 - with: - name: "${{ strategy.matrix.platform.distro }}_packages" - - name: Install packages - run: apt update && apt upgrade -y && apt install -y --fix-missing ./dropbox_*.*.*_amd64.deb - - test_rpm: - strategy: - matrix: - version: [latest, rawhide] - runs-on: ubuntu-latest - container: - image: "fedora:${{ strategy.matrix.version }}" - steps: - - name: Download packages - uses: actions/download-artifact@v4 - with: - name: "fedora_packages" - - name: Install packages - run: dnf upgrade && dnf install ./nautilus-dropbox-*.*.*-*.*.x86_64.rpm From 73735c5f3f0bd2a5205b0373f8511097c11d7028 Mon Sep 17 00:00:00 2001 From: Julia Pitts Date: Wed, 17 Apr 2024 23:36:13 +0000 Subject: [PATCH 3/8] Try actually using the right configuration for the matrix. --- .github/workflows/canary.yml | 41 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 12848bc..d017e85 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -13,29 +13,30 @@ jobs: validate-source-build: strategy: matrix: - - image: ubuntu:devel - deps-script: install-apt-deps.sh - codename: $VERSION_CODENAME - pretty-name: $NAME $VERSION - codenames: $UBUNTU_CODENAMES - - image: debian:sid - deps-script: install-apt-deps.sh - codename: $VERSION_CODENAME - pretty-name: $NAME $VERSION - codenames: $UBUNTU_CODENAMES - - image: fedora:rawhide - deps-script: install-rpm-deps.sh - codename: $VERSION_ID - pretty-name: Fedora $VERSION_ID - codenames: $FEDORA_CODENAMES + config: + - image: ubuntu:devel + deps-script: install-apt-deps.sh + codename: $VERSION_CODENAME + pretty-name: $NAME $VERSION + codenames: $UBUNTU_CODENAMES + - image: debian:sid + deps-script: install-apt-deps.sh + codename: $VERSION_CODENAME + pretty-name: $NAME $VERSION + codenames: $UBUNTU_CODENAMES + - image: fedora:rawhide + deps-script: install-rpm-deps.sh + codename: $VERSION_ID + pretty-name: Fedora $VERSION_ID + codenames: $FEDORA_CODENAMES runs-on: ubuntu-latest container: - image: ${{ strategy.matrix.image }} + image: ${{ strategy.matrix.config.image }} steps: - name: Clone repo uses: actions/checkout@v3 - name: Install deps - run: ./${{ strategy.matrix.deps-script }} + run: ./${{ strategy.matrix.config.deps-script }} - name: Test build run: ./autogen.sh && make && make install - name: Run tests @@ -45,9 +46,9 @@ jobs: . ./distro-info.sh . /etc/os-release ./check-distro-info-support.sh \ - "${{ strategy.matrix.codename }}" \ - "${{ strategy.matrix.pretty-name }}" \ - "${{ strategy.matrix.codenames }}" + "${{ strategy.matrix.config.codename }}" \ + "${{ strategy.matrix.config.pretty-name }}" \ + "${{ strategy.matrix.config.codenames }}" build-packages: runs-on: ubuntu-latest From 55df733eb13a7f1e338309677b97093788e1e719 Mon Sep 17 00:00:00 2001 From: Julia Pitts Date: Wed, 17 Apr 2024 23:38:20 +0000 Subject: [PATCH 4/8] Read documentation more carefully next time. --- .github/workflows/canary.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index d017e85..57b982e 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -31,12 +31,12 @@ jobs: codenames: $FEDORA_CODENAMES runs-on: ubuntu-latest container: - image: ${{ strategy.matrix.config.image }} + image: ${{ matrix.config.image }} steps: - name: Clone repo uses: actions/checkout@v3 - name: Install deps - run: ./${{ strategy.matrix.config.deps-script }} + run: ./${{ matrix.config.deps-script }} - name: Test build run: ./autogen.sh && make && make install - name: Run tests @@ -46,9 +46,9 @@ jobs: . ./distro-info.sh . /etc/os-release ./check-distro-info-support.sh \ - "${{ strategy.matrix.config.codename }}" \ - "${{ strategy.matrix.config.pretty-name }}" \ - "${{ strategy.matrix.config.codenames }}" + "${{ matrix.config.codename }}" \ + "${{ matrix.config.pretty-name }}" \ + "${{ matrix.config.codenames }}" build-packages: runs-on: ubuntu-latest @@ -89,14 +89,14 @@ jobs: version: devel runs-on: ubuntu-latest container: - image: "${{ strategy.matrix.platform.distro }}:${{ strategy.matrix.platform.version }}" + image: "${{ matrix.platform.distro }}:${{ matrix.platform.version }}" env: DEBIAN_FRONTEND: noninteractive steps: - name: Download packages uses: actions/download-artifact@v4 with: - name: "${{ strategy.matrix.platform.distro }}_packages" + name: "${{ matrix.platform.distro }}_packages" - name: Install packages run: apt update && apt upgrade -y && apt install -y --fix-missing ./dropbox_*.*.*_amd64.deb @@ -107,7 +107,7 @@ jobs: version: [latest, rawhide] runs-on: ubuntu-latest container: - image: "fedora:${{ strategy.matrix.version }}" + image: "fedora:${{ matrix.version }}" steps: - name: Download packages uses: actions/download-artifact@v4 From 0ee6337c497652ea0b1437434e0548a8cd8a7a8c Mon Sep 17 00:00:00 2001 From: Julia Pitts Date: Wed, 17 Apr 2024 23:39:31 +0000 Subject: [PATCH 5/8] Specify inter-workflow dependencies. --- .github/workflows/canary.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 57b982e..0f48529 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -74,6 +74,7 @@ jobs: path: build/fedora/pool test_debs: + needs: build-packages strategy: matrix: platform: @@ -101,6 +102,7 @@ jobs: run: apt update && apt upgrade -y && apt install -y --fix-missing ./dropbox_*.*.*_amd64.deb test_rpm: + needs: build-packages strategy: matrix: # Fedora doesn't have LTS releases, so just run on latest and rawhide. From 1c64bffcc3a7503e5b7f6f362809fba3cfecb237 Mon Sep 17 00:00:00 2001 From: Julia Pitts Date: Wed, 17 Apr 2024 23:43:06 +0000 Subject: [PATCH 6/8] Use correct Debian values in validate-source-build. --- .github/workflows/canary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 0f48529..8f6c971 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -22,8 +22,8 @@ jobs: - image: debian:sid deps-script: install-apt-deps.sh codename: $VERSION_CODENAME - pretty-name: $NAME $VERSION - codenames: $UBUNTU_CODENAMES + pretty-name: $PRETTY_NAME + codenames: $DEBIAN_CODENAMES - image: fedora:rawhide deps-script: install-rpm-deps.sh codename: $VERSION_ID From bdc8f1a4d27f4dab1a2ca6c027af0c7024680071 Mon Sep 17 00:00:00 2001 From: Julia Pitts Date: Wed, 17 Apr 2024 23:51:16 +0000 Subject: [PATCH 7/8] Pass -y to dnf. --- .github/workflows/canary.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 8f6c971..5badee9 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -116,4 +116,4 @@ jobs: with: name: "fedora_packages" - name: Install packages - run: dnf upgrade && dnf install ./nautilus-dropbox-*.*.*-*.*.x86_64.rpm + run: dnf upgrade -y && dnf install -y ./nautilus-dropbox-*.*.*-*.*.x86_64.rpm From 929549ac3f922cbf841ebd66f6b60bbbbab5000e Mon Sep 17 00:00:00 2001 From: Julia Pitts Date: Thu, 18 Apr 2024 00:09:26 +0000 Subject: [PATCH 8/8] Use checkout@v4. --- .github/workflows/canary.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/canary.yml b/.github/workflows/canary.yml index 5badee9..adbb11b 100644 --- a/.github/workflows/canary.yml +++ b/.github/workflows/canary.yml @@ -34,7 +34,7 @@ jobs: image: ${{ matrix.config.image }} steps: - name: Clone repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install deps run: ./${{ matrix.config.deps-script }} - name: Test build @@ -54,7 +54,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Clone repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build packages run: ./build_packages.sh - name: Upload Ubuntu packages