Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 31 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v6
with:
node-version: "20"

- name: Install dependencies
run: npm install
run: npm ci --include=dev

- name: Run tests
run: npm test
Expand All @@ -43,6 +43,7 @@ jobs:
build-platform:
needs: [test]
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
Expand All @@ -60,25 +61,26 @@ jobs:

- name: Normalize image names
run: |
echo "CONSOLE_IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
echo "CONSOLE_IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"

- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
preinstalled-runtimes: true
android: true
dotnet: true
haskell: true
large-packages: true
# Package availability differs between the AMD64 and ARM64 runners.
large-packages: false
docker-images: true
swap-storage: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4

- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -87,14 +89,14 @@ jobs:
# Console image - push by digest with repository name
- name: Build Console image (single platform)
id: build-console
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
context: .
platforms: ${{ matrix.platform }}
push: ${{ github.event_name != 'pull_request' }}
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }},push-by-digest=true
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}:buildcache-${{ matrix.arch }}
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}:buildcache-${{ matrix.arch }},mode=max
cache-to: ${{ github.event_name != 'pull_request' && format('type=registry,ref={0}/{1}:buildcache-{2},mode=max', env.REGISTRY, env.CONSOLE_IMAGE_NAME, matrix.arch) || '' }}

- name: Save digests to files
if: github.event_name != 'pull_request'
Expand All @@ -103,7 +105,7 @@ jobs:

- name: Upload digests artifact
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: digests-${{ matrix.arch }}
path: |
Expand All @@ -117,41 +119,44 @@ jobs:
steps:
- name: Normalize image names
run: |
echo "CONSOLE_IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
echo "CONSOLE_IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> "$GITHUB_ENV"

- name: Download all digests
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
pattern: digests-*
merge-multiple: true

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v4

- name: Extract metadata for Console image
id: meta-console
uses: docker/metadata-action@v5
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}

- name: Create multi-arch manifest for Console
env:
IMAGE_TAGS: ${{ steps.meta-console.outputs.tags }}
run: |
AMD64_DIGEST=$(cat digests-amd64-console-digest.txt)
ARM64_DIGEST=$(cat digests-arm64-console-digest.txt)
echo AMD64_DIGEST=$AMD64_DIGEST
echo ARM64_DIGEST=$ARM64_DIGEST
TAGS=(${{ steps.meta-console.outputs.tags }})
TAG_ARGS=""
for tag in "${TAGS[@]}"; do
TAG_ARGS="$TAG_ARGS --tag $tag"
done
docker buildx imagetools create $TAG_ARGS \
${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}@$AMD64_DIGEST \
${{ env.REGISTRY }}/${{ env.CONSOLE_IMAGE_NAME }}@$ARM64_DIGEST
echo "AMD64_DIGEST=$AMD64_DIGEST"
echo "ARM64_DIGEST=$ARM64_DIGEST"
TAG_ARGS=()
while IFS= read -r tag; do
if [[ -n "$tag" ]]; then
TAG_ARGS+=(--tag "$tag")
fi
done <<< "$IMAGE_TAGS"
docker buildx imagetools create "${TAG_ARGS[@]}" \
"$REGISTRY/$CONSOLE_IMAGE_NAME@$AMD64_DIGEST" \
"$REGISTRY/$CONSOLE_IMAGE_NAME@$ARM64_DIGEST"
60 changes: 60 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions tests/ui/desktop.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,12 @@ test('manual mouse drag swaps occupied cells, suppresses launching, persists, an
await page.getByRole('button', { name: 'Keep my layout' }).click();
expect(await page.evaluate(() => Desktop.getPreferences().mode)).toBe('manual');
await page.locator('#reset-layout').click();
await page.getByRole('button', { name: 'Reset layout', exact: true }).last().click();
expect(await page.evaluate(() => Desktop.getPreferences())).toMatchObject({ mode: 'auto', positions: {} });
await page.locator('#reset-dialog').getByRole('button', { name: 'Reset layout', exact: true }).click();
// The native dialog dispatches its close event asynchronously after the click.
await expect.poll(() => page.evaluate(() => {
const { mode, positions } = Desktop.getPreferences();
return { mode, positions };
})).toEqual({ mode: 'auto', positions: {} });
await page.locator('input[value="manual"]').check();
await page.locator('#reset-layout').click();
await page.keyboard.press('Escape');
Expand Down
Loading