-
-
Notifications
You must be signed in to change notification settings - Fork 12
76 lines (65 loc) · 2.17 KB
/
integration-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
name: pi-gen-action-integration-test
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
- 'renovate.json'
branches:
- master
pull_request:
types: [ labeled, opened, synchronize, reopened ]
env:
MOUNT_DIR: /mnt
ROOTFS_DIR: /mnt/root
CONFIG_TIMEZONE: Europe/Berlin
CONFIG_LOCALE: de_DE.UTF-8
CONFIG_USERNAME: pi-gen
CONFIG_HOSTNAME: pi-gen-test
jobs:
integration-test:
runs-on: ubuntu-latest
if: github.ref_name == 'master' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'test'))
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Run pi-gen build
uses: ./
id: build
with:
image-name: integration-test
stage-list: stage0 stage1 stage2 ./__test__/it-test-stage
verbose-output: true
enable-noobs: true
compression: xz
compression-level: 1
locale: ${{ env.CONFIG_LOCALE }}
hostname: ${{ env.CONFIG_HOSTNAME }}
keyboard-keymap: de
keyboard-layout: German - no dead keys
username: ${{ env.CONFIG_USERNAME }}
wpa-essid: foo
wpa-password: '1234567890'
timezone: ${{ env.CONFIG_TIMEZONE }}
- name: List working directory
run: tree
- name: Uncompress image and mount loopback device
run: |
set -ex
xz -d ${{ steps.build.outputs.image-path }}
file_name="${{ steps.build.outputs.image-path }}"
./__test__/mount-pi-gen-image.sh "${file_name/.xz/}" $MOUNT_DIR
- name: Test configuration values
run: |
set -ex
test -x ${ROOTFS_DIR}/usr/bin/node
test "$(cat ${ROOTFS_DIR}/etc/hostname)" = "$CONFIG_HOSTNAME"
grep $CONFIG_USERNAME ${ROOTFS_DIR}/etc/passwd
source ${ROOTFS_DIR}/etc/default/locale
test "$LANG" = "$CONFIG_LOCALE"
test "$(cat ${ROOTFS_DIR}/etc/timezone)" = "$CONFIG_TIMEZONE"
- name: Remove test label from PR
uses: actions-ecosystem/action-remove-labels@v1
if: always()
with:
labels: test