Skip to content

fix(lint): enable revive blank-imports, remove unused import #1184

fix(lint): enable revive blank-imports, remove unused import

fix(lint): enable revive blank-imports, remove unused import #1184

Workflow file for this run

name: Desktop CI
on:
push:
branches: [electron-ui, main]
pull_request:
workflow_dispatch:
concurrency:
group: desktop-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
desktop: ${{ steps.filter.outputs.desktop }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4
id: filter
with:
filters: |
desktop:
- 'desktop/**'
- '.github/workflows/desktop-ci.yml'
lint-and-test:
needs: changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
if: needs.changes.outputs.desktop == 'true'
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
if: needs.changes.outputs.desktop == 'true'
with:
node-version: 24
cache: npm
cache-dependency-path: desktop/package-lock.json
- name: Install dependencies
if: needs.changes.outputs.desktop == 'true'
working-directory: desktop
run: npm ci
- name: Type check
if: needs.changes.outputs.desktop == 'true'
working-directory: desktop
run: npm run check
- name: Unit tests
if: needs.changes.outputs.desktop == 'true'
working-directory: desktop
run: npm run test
build-desktop:
needs: [changes, lint-and-test]
if: needs.changes.outputs.desktop == 'true'
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
go-os: darwin
go-arch: universal
builder-args: --mac
- os: windows-2022
go-os: windows
go-arch: amd64
builder-args: --win
- os: ubuntu-latest
go-os: linux
go-arch: amd64
builder-args: --linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version-file: go.mod
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 24
cache: npm
cache-dependency-path: desktop/package-lock.json
- name: Build CLI (unix)
if: runner.os != 'Windows'
env:
CGO_ENABLED: "0"
run: |
if [ "${{ matrix.go-arch }}" = "universal" ]; then
# macOS universal binary: build both architectures and lipo them
GOOS=darwin GOARCH=amd64 go build -tags netgo,osusergo -o devsy-amd64 .
GOOS=darwin GOARCH=arm64 go build -tags netgo,osusergo -o devsy-arm64 .
lipo -create -output desktop/resources/bin/devsy devsy-amd64 devsy-arm64
rm devsy-amd64 devsy-arm64
else
GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} go build -tags netgo,osusergo -o desktop/resources/bin/devsy .
fi
chmod +x desktop/resources/bin/devsy
- name: Build CLI (windows)
if: runner.os == 'Windows'
shell: pwsh
env:
CGO_ENABLED: "0"
run: |
$env:GOOS = "windows"
$env:GOARCH = "amd64"
go build -tags netgo,osusergo -o desktop/resources/bin/devsy.exe .
- name: Configure Windows build tools
if: runner.os == 'Windows'
shell: pwsh
run: echo "GYP_MSVS_VERSION=2022" >> $env:GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7
with:
python-version: "3.14"
- name: Install setuptools
run: pip install setuptools
- name: Install dependencies
working-directory: desktop
run: npm ci
- name: Install xvfb
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y xvfb
- name: Run e2e tests (Linux)
if: runner.os == 'Linux'
working-directory: desktop
run: |
npm run electron:build
xvfb-run npx playwright test
- name: Run e2e tests (macOS/Windows)
if: runner.os != 'Linux'
working-directory: desktop
run: |
npm run electron:build
npx playwright test
- name: Package with electron-builder
working-directory: desktop
run: npx electron-builder ${{ matrix.builder-args }} --config electron-builder.yml
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CSC_IDENTITY_AUTO_DISCOVERY: "false"
- name: Upload artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: desktop-${{ matrix.os }}
path: |
desktop/release/*.dmg
desktop/release/*.zip
desktop/release/*.exe
desktop/release/*.AppImage
desktop/release/*.deb
desktop/release/*.rpm
if-no-files-found: warn
build-flatpak:
needs: [changes, build-desktop]
if: needs.changes.outputs.desktop == 'true'
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48@sha256:50fea670968fd3ec4aeeb3a91d9d807d0af6eab3c3b44c33d4c40c311832c8fa
options: --privileged
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Download Linux .deb artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: desktop-ubuntu-latest
path: desktop/flatpak/
- name: Find and rename .deb file
working-directory: desktop/flatpak
run: |
DEB=$(find . -maxdepth 1 -name '*.deb' -print -quit)
if [ -n "$DEB" ]; then
mv "$DEB" devsy-desktop.deb
else
echo "No .deb file found"
exit 1
fi
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@401fe28a8384095fc1531b9d320b292f0ee45adb # v6
with:
manifest-path: desktop/flatpak/sh.devsy.app.yml
bundle: Devsy.flatpak
cache-key: flatpak-builder-${{ github.sha }}
- name: Upload Flatpak artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: desktop-flatpak
path: Devsy.flatpak