Skip to content

CI

CI #963

Workflow file for this run

---
name: CI
"on":
pull_request:
push:
branches-ignore:
- 'dependabot/**'
schedule:
- cron: '29 4 1 * *'
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
go:
- 1.18.x # ubuntu jammy
- 1.19.x # debian bookworm
- 1.20.x
- 1.x # latest
include:
- staticcheck: latest
- go: 1.18.x
staticcheck: v0.3
- go: 1.19.x
staticcheck: v0.3
name: go${{ matrix.go }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y -q appstream gettext libgtk-3-dev \
libxml2-utils shellcheck yamllint
go install \
honnef.co/go/tools/cmd/staticcheck@${{ matrix.staticcheck }}
- run: go mod graph
- run: make
- run: make check
- run: make test
flatpak-config:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: false # No go code will be compiled, do not cache nothing.
- run: go mod graph
- run: make -B flatpak/modules.txt
- run: make -B flatpak/appcenter.yml
- run: make -B flatpak/flathub.yml
- name: Upload flatpak-config artifact
uses: actions/upload-artifact@v4
with:
name: flatpak-config
if-no-files-found: error
path: |
flatpak/modules.txt
flatpak/*.yml
flatpak-builder:
strategy:
matrix:
arch:
- aarch64
- x86_64
repo:
- appcenter
- flathub
include:
- repo: appcenter
repo-url: https://flatpak.elementary.io/repo.flatpakrepo
image: ghcr.io/elementary/flatpak-platform/runtime:7.2
- repo: flathub
repo-url: https://flathub.org/repo/flathub.flatpakrepo
image: bilelmoussaoui/flatpak-github-actions:freedesktop-22.08
name: ${{ matrix.repo }}-${{ matrix.arch }}
needs: flatpak-config
runs-on: ubuntu-latest
container:
image: ${{ matrix.image }}
options: --privileged
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download flatpak-config artifact
uses: actions/download-artifact@v4
with:
name: flatpak-config
path: flatpak
- name: Configuring build
run: tools/app-version.sh | tee tools/app-version.txt
- name: Install QEMU dependencies
if: ${{ matrix.arch == 'aarch64' && matrix.repo == 'flathub' }}
run: dnf -y install docker
- name: Initialize QEMU
if: ${{ matrix.arch == 'aarch64' }}
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
manifest-path: flatpak/${{ matrix.repo }}.yml
repository-name: ${{ matrix.repo }}
repository-url: ${{ matrix.repo-url }}
arch: ${{ matrix.arch }}
bundle: xkcd-gtk-${{ matrix.repo }}.flatpak
verbose: true