forked from flatpak/flatpak-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 5
118 lines (113 loc) · 3.56 KB
/
flatpak-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
on:
push:
# branches: [master]
pull_request:
name: CI
jobs:
flatpak-builder:
name: Flatpak Builder
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
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: Install QEMU deps
if: ${{ matrix.arch != 'x86_64' }}
run: |
dnf -y install docker
- name: Set up QEMU
if: ${{ matrix.arch != 'x86_64' }}
uses: docker/setup-qemu-action@v2
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: bilelmoussaoui/flatpak-github-actions:gnome-44
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: bilelmoussaoui/flatpak-github-actions:gnome-44
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: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
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 16
uses: actions/setup-node@v3
with:
node-version: "16"
- 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