CI and test enhancements #70
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: master | |
pull_request: | |
branches: master | |
workflow_dispatch: | |
name: CI | |
jobs: | |
flatpak-builder: | |
name: Flatpak Builder | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-47 | |
options: --privileged | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86_64, aarch64] | |
cache: [use-cache, no-cache] | |
restore: [cache-restored, no-cache-restored] | |
exclude: | |
- arch: aarch64 | |
cache: no-cache | |
- arch: aarch64 | |
restore: no-cache-restored | |
- cache: no-cache | |
restore: cache-restored | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up docker | |
if: ${{ matrix.arch != 'x86_64' }} | |
run: | | |
curl https://download.docker.com/linux/static/stable/aarch64/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@v3 | |
with: | |
platforms: arm64 | |
- uses: ./flatpak-builder | |
with: | |
bundle: org.example.MyApp.Devel-${{ matrix.cache }}-${{ matrix.restore }}.flatpak | |
manifest-path: ./flatpak-builder/tests/test-project/org.example.MyApp.yaml | |
cache: ${{ matrix.cache == 'use-cache' }} | |
restore-cache: ${{ matrix.restore == 'cache-restored' }} | |
cache-key: flatpak-builder-${{ github.sha }}-${{ matrix.restore }} | |
arch: ${{ matrix.arch }} | |
verbose: true | |
# TODO: setup a flat-manager before and use it later here | |
#- uses: ./flat-manager | |
# with: | |
# repository: elementary | |
# flat-manager-url: https://flatpak-api.elementary.io | |
# token: some_very_hidden_token | |
flatpak-builder-stop-at: | |
name: Flatpak Builder Stop At | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-47 | |
options: --privileged | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./flatpak-builder | |
with: | |
manifest-path: ./flatpak-builder/tests/test-project/org.example.MyApp.yaml | |
stop-at-module: testproject | |
cache: false | |
verbose: true | |
flatpak-builder-cache-hit: | |
name: Flatpak Builder Cache Hit | |
runs-on: ubuntu-latest | |
needs: flatpak-builder | |
container: | |
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-47 | |
options: --privileged | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./flatpak-builder | |
with: | |
bundle: org.example.MyApp.Devel-cache-hit.flatpak | |
manifest-path: ./flatpak-builder/tests/test-project/org.example.MyApp.yaml | |
cache-key: flatpak-builder-${{ github.sha }}-no-cache-restored | |
verbose: true | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x, 22.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn install --also=dev | |
working-directory: flatpak-builder | |
- run: yarn test | |
working-directory: flatpak-builder | |
eslint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
- run: yarn install --also=dev | |
working-directory: flatpak-builder | |
- run: yarn run eslint . | |
working-directory: flatpak-builder | |
- run: yarn install --also=dev | |
working-directory: flat-manager | |
- run: yarn run eslint . | |
working-directory: flat-manager |