Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI and test enhancements #13

Merged
merged 11 commits into from
Nov 5, 2024
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name: Docker images
jobs:
build-images:
name: Build & push Docker images
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
permissions:
packages: write

Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
driver-opts: network=host

- name: Build & push the base image to local registry
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
Expand All @@ -88,7 +88,7 @@ jobs:
RUN --security=insecure flatpak install -y --noninteractive ${{matrix.runtime.remote}} ${{ matrix.runtime.packages }}

- name: Build & push the ${{ matrix.runtime.name }} image
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
allow: security.insecure
context: .
Expand Down
29 changes: 17 additions & 12 deletions .github/workflows/flatpak-test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
on:
push:
# branches: [master]
branches: master
pull_request:
branches: master
workflow_dispatch:

name: CI
jobs:
flatpak-builder:
name: Flatpak Builder
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-47
options: --privileged
strategy:
fail-fast: false
Expand All @@ -26,13 +28,16 @@ jobs:
restore: cache-restored
steps:
- uses: actions/checkout@v4
- name: Install QEMU deps
- name: Set up docker
if: ${{ matrix.arch != 'x86_64' }}
run: |
dnf -y install docker
curl https://download.docker.com/linux/static/stable/x86_64/docker-27.3.1.tgz --output docker.tgz
tar xzvf docker.tgz
chmod -R +x docker
mv docker/* /usr/bin
- name: Set up QEMU
if: ${{ matrix.arch != 'x86_64' }}
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: ./flatpak-builder
Expand All @@ -55,7 +60,7 @@ jobs:
name: Flatpak Builder Stop At
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-47
options: --privileged
steps:
- uses: actions/checkout@v4
Expand All @@ -71,7 +76,7 @@ jobs:
runs-on: ubuntu-latest
needs: flatpak-builder
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-47
options: --privileged
steps:
- uses: actions/checkout@v4
Expand All @@ -87,11 +92,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x, 22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: yarn install --also=dev
Expand All @@ -104,10 +109,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18
uses: actions/setup-node@v3
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: "18"
node-version: "22"
- run: yarn install --also=dev
working-directory: flatpak-builder
- run: yarn run eslint .
Expand Down
4 changes: 2 additions & 2 deletions flatpak-builder/tests/app-test/manifest-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
id: org.example.MyApp.Devel
runtime: org.gnome.Platform
runtime-version: "44"
runtime-version: "47"
sdk: org.gnome.Sdk
command: test-project
finish-args:
Expand All @@ -17,4 +17,4 @@ modules:
- -Dprofile=development
sources:
- type: git
url: https://github.com/bilelmoussaoui/flatpak-github-actions.git
url: https://github.com/flathub-infra/flatpak-github-actions.git
4 changes: 2 additions & 2 deletions flatpak-builder/tests/hash.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const { computeHash } = require('../index')

test('The manifest hash should be computed properly', async () => {
const hash = await computeHash('./tests/manifest-1.yaml')
expect(hash).toBe('8c43f78c9f33c1f379521211c9b9e91fe051cef3f638e4427026beb27261a587')
expect(hash).toBe('83c43af4e8b865a3a116b3759c7395dce19e965f0e1d639965826267c145df30')

const hash2 = await computeHash('./tests/manifest-3.json')
expect(hash2).toBe('fb531a4e4d3227ff9cdb37b8d1b9830878aa63542a066c2bd157dd94c7dda1ba')
expect(hash2).toBe('201c1afd5edd78d766cc9b0b74852e9459a7231bb40dcda0be4a73b1c394d75b')
})
4 changes: 2 additions & 2 deletions flatpak-builder/tests/manifest-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
app-id: org.example.MyApp.Devel
runtime: org.gnome.Platform
runtime-version: "44"
runtime-version: "47"
sdk: org.gnome.Sdk
command: test-project
finish-args:
Expand All @@ -17,4 +17,4 @@ modules:
- -Dprofile=development
sources:
- type: git
url: https://github.com/bilelmoussaoui/flatpak-github-actions.git
url: https://github.com/flathub-infra/flatpak-github-actions.git
2 changes: 1 addition & 1 deletion flatpak-builder/tests/manifest-3.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"app-id": "org.gnome.design.Contrast.Devel",
"runtime": "org.gnome.Platform",
"runtime-version": "44",
"runtime-version": "47",
"sdk": "org.gnome.Sdk",
"sdk-extensions": ["org.freedesktop.Sdk.Extension.rust-stable"],
"command": "contrast",
Expand Down
2 changes: 1 addition & 1 deletion flatpak-builder/tests/parser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test('The manifest should be parsed correctly', async () => {
sources: [
{
type: 'git',
url: 'https://github.com/bilelmoussaoui/flatpak-github-actions.git'
url: 'https://github.com/flathub-infra/flatpak-github-actions.git'
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion flatpak-builder/tests/test-project/org.example.MyApp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
app-id: org.example.MyApp.Devel
runtime: org.gnome.Platform
runtime-version: "44"
runtime-version: "47"
sdk: org.gnome.Sdk
command: test-project
finish-args:
Expand Down