Skip to content

Commit

Permalink
Improve tooling (#11)
Browse files Browse the repository at this point in the history
* GitHub CI: Update config

* Update .gitignore

* Add script to build, install and run app

* Add config for Visual Studio Code
  • Loading branch information
meisenzahl authored Nov 2, 2021
1 parent e39678c commit 5af5876
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 30 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
flatpak:
name: Flatpak
runs-on: ubuntu-latest

strategy:
matrix:
arch: [x86_64, aarch64]
# Don't fail the whole workflow if one architecture fails
fail-fast: false

container:
image: ghcr.io/elementary/flatpak-platform/runtime:6-${{ matrix.arch }}
options: --privileged

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU for aarch64 emulation
if: ${{ matrix.arch != 'x86_64' }}
uses: docker/setup-qemu-action@v1
with:
platforms: arm64

- name: Build
uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4
with:
bundle: com.github.manexim.insomnia.flatpak
manifest-path: com.github.manexim.insomnia.yml
run-tests: true
repository-name: appcenter
repository-url: https://flatpak.elementary.io/repo.flatpakrepo
cache-key: "flatpak-builder-${{ github.sha }}"
arch: ${{ matrix.arch }}

lint:
name: Lint
runs-on: ubuntu-latest

container:
image: valalang/lint

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Lint
run: io.elementary.vala-lint -d .
30 changes: 0 additions & 30 deletions .github/workflows/main.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
build
build-dir
.flatpak-builder
repo
*.flatpak
17 changes: 17 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build & Run",
"type": "shell",
"command": "./app build && ./app install && ./app run",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
19 changes: 19 additions & 0 deletions app
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# fail on first error
set -e

APP=com.github.manexim.insomnia

case "$1" in
build)
flatpak-builder --repo=repo build ${APP}.yml --force-clean
flatpak build-bundle repo ${APP}.flatpak --runtime-repo=https://flatpak.elementary.io/repo.flatpakrepo ${APP} master
;;
install)
flatpak install --user -y ${APP}.flatpak
;;
run)
flatpak run ${APP}
;;
esac

0 comments on commit 5af5876

Please sign in to comment.