customize/runner: pass stdin to modules #228
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
name: CI | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "bin/**" | |
env: | |
TERM: xterm-256color | |
jobs: | |
format: | |
name: Check format | |
uses: es-progress/.github/.github/workflows/beautysh.yml@main | |
linter: | |
name: Linting | |
needs: format | |
uses: es-progress/.github/.github/workflows/shellcheck.yml@main | |
check: | |
name: Check changed modules | |
runs-on: ubuntu-20.04 | |
needs: linter | |
outputs: | |
apps: ${{ steps.modules.outputs.apps }} | |
gnome: ${{ steps.modules.outputs.gnome }} | |
other: ${{ steps.modules.outputs.other }} | |
packages: ${{ steps.modules.outputs.packages }} | |
services: ${{ steps.modules.outputs.services }} | |
shell: ${{ steps.modules.outputs.shell }} | |
system: ${{ steps.modules.outputs.system }} | |
tools: ${{ steps.modules.outputs.tools }} | |
post-install: ${{ steps.modules.outputs.post-install }} | |
remix: ${{ steps.modules.outputs.remix }} | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
run: | | |
git diff --name-only origin/main... > ~/changed.files | |
cat ~/changed.files | |
- name: Check changed modules | |
# Step need an id to be defined to later retrieve the output value | |
id: modules | |
run: | | |
if grep -qs customize/apps ~/changed.files; then | |
echo Will run customize/apps | |
echo apps=yes >> "$GITHUB_OUTPUT" | |
fi | |
if grep -qs customize/gnome ~/changed.files; then | |
echo Will run customize/gnome | |
echo gnome=yes >> "$GITHUB_OUTPUT" | |
fi | |
if grep -qs customize/other ~/changed.files; then | |
echo Will run customize/other | |
echo other=yes >> "$GITHUB_OUTPUT" | |
fi | |
if grep -qs customize/packages ~/changed.files; then | |
echo Will run customize/packages | |
echo packages=yes >> "$GITHUB_OUTPUT" | |
fi | |
if grep -qs customize/services ~/changed.files; then | |
echo Will run customize/services | |
echo services=yes >> "$GITHUB_OUTPUT" | |
fi | |
if grep -qs customize/shell ~/changed.files; then | |
echo Will run customize/shell | |
echo shell=yes >> "$GITHUB_OUTPUT" | |
fi | |
if grep -qs customize/system ~/changed.files; then | |
echo Will run customize/system | |
echo system=yes >> "$GITHUB_OUTPUT" | |
fi | |
if grep -qs customize/tools ~/changed.files; then | |
echo Will run customize/tools | |
echo tools=yes >> "$GITHUB_OUTPUT" | |
fi | |
if grep -qs bin/install/post-install ~/changed.files; then | |
echo Will run install/post-install | |
echo post-install=yes >> "$GITHUB_OUTPUT" | |
fi | |
if grep -qs bin/remix ~/changed.files; then | |
echo Will run remix | |
echo remix=yes >> "$GITHUB_OUTPUT" | |
fi | |
shell: bash | |
tests-apps: | |
name: Integration tests (customize/apps) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.apps == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Execute scripts (1st pass) | |
run: | | |
./bin/zephyrctl customize tester atom | |
./bin/zephyrctl customize tester jmeter | |
./bin/zephyrctl customize tester pulse-effects | |
./bin/zephyrctl customize tester vbox | |
shell: bash | |
- name: Execute scripts (2nd pass) | |
run: | | |
./bin/zephyrctl customize tester atom | |
./bin/zephyrctl customize tester jmeter | |
./bin/zephyrctl customize tester pulse-effects | |
./bin/zephyrctl customize tester vbox | |
shell: bash | |
tests-gnome: | |
name: Integration tests (customize/gnome) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.gnome == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Install GNOME | |
run: | | |
sudo apt-get update | |
sudo apt-get --quiet install --yes --no-install-recommends gnome-session gnome-software gnome-system-monitor gdm3 nautilus | |
- name: Execute scripts (1st pass) | |
run: | | |
./bin/zephyrctl customize tester autostart | |
# Dash-to-panel needs a running GNOME, was unable to do it in CI --> skip | |
# ./bin/zephyrctl customize tester dash-to-panel | |
./bin/zephyrctl customize tester fonts | |
./bin/zephyrctl customize tester gnome-config | |
./bin/zephyrctl customize tester user-dirs | |
./bin/zephyrctl customize tester wallpaper | |
shell: bash | |
- name: Execute scripts (2nd pass) | |
run: | | |
./bin/zephyrctl customize tester autostart | |
# ./bin/zephyrctl customize tester dash-to-panel | |
./bin/zephyrctl customize tester fonts | |
./bin/zephyrctl customize tester gnome-config | |
./bin/zephyrctl customize tester user-dirs | |
./bin/zephyrctl customize tester wallpaper | |
shell: bash | |
tests-other: | |
name: Integration tests (customize/other) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.other == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Execute scripts (1st pass) | |
run: | | |
./bin/zephyrctl customize tester cron | |
./bin/zephyrctl customize tester local | |
shell: bash | |
- name: Execute scripts (2nd pass) | |
run: | | |
./bin/zephyrctl customize tester cron | |
./bin/zephyrctl customize tester local | |
shell: bash | |
tests-packages: | |
name: Integration tests (customize/packages) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.packages == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Execute scripts (1st pass) | |
run: | | |
./bin/zephyrctl customize tester apt | |
./bin/zephyrctl customize tester bin | |
./bin/zephyrctl customize tester node | |
./bin/zephyrctl customize tester pip | |
./bin/zephyrctl customize tester snap | |
shell: bash | |
- name: Execute scripts (2nd pass) | |
run: | | |
./bin/zephyrctl customize tester apt | |
./bin/zephyrctl customize tester bin | |
./bin/zephyrctl customize tester node | |
./bin/zephyrctl customize tester pip | |
./bin/zephyrctl customize tester snap | |
shell: bash | |
tests-services: | |
name: Integration tests (customize/services) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.services == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Install dependencies | |
run: ./bin/zephyrctl customize tester certificates | |
- name: Execute scripts (1st pass) | |
run: | | |
./bin/zephyrctl customize tester apache | |
./bin/zephyrctl customize tester mariadb | |
./bin/zephyrctl customize tester php | |
./bin/zephyrctl customize tester phpmyadmin | |
shell: bash | |
- name: Execute scripts (2nd pass) | |
run: | | |
./bin/zephyrctl customize tester apache | |
./bin/zephyrctl customize tester mariadb | |
./bin/zephyrctl customize tester php | |
./bin/zephyrctl customize tester phpmyadmin | |
shell: bash | |
tests-shell: | |
name: Integration tests (customize/shell) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.shell == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Execute scripts (1st pass) | |
run: | | |
./bin/zephyrctl customize tester bash | |
./bin/zephyrctl customize tester scripts | |
shell: bash | |
- name: Execute scripts (2nd pass) | |
run: | | |
./bin/zephyrctl customize tester bash | |
./bin/zephyrctl customize tester scripts | |
shell: bash | |
tests-system: | |
name: Integration tests (customize/system) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.system == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Install dependencies | |
run: sudo chmod =0440 /etc/sudoers.d/runner | |
- name: Execute scripts (1st pass) | |
run: | | |
./bin/zephyrctl customize tester certificates | |
./bin/zephyrctl customize tester dirs | |
./bin/zephyrctl customize tester fstab | |
./bin/zephyrctl customize tester locale | |
./bin/zephyrctl customize tester netplan | |
./bin/zephyrctl customize tester resolved | |
./bin/zephyrctl customize tester shorewall | |
./bin/zephyrctl customize tester sudo | |
./bin/zephyrctl customize tester systemd | |
./bin/zephyrctl customize tester users | |
shell: bash | |
- name: Execute scripts (2nd pass) | |
run: | | |
./bin/zephyrctl customize tester certificates | |
./bin/zephyrctl customize tester dirs | |
./bin/zephyrctl customize tester fstab | |
./bin/zephyrctl customize tester locale | |
./bin/zephyrctl customize tester netplan | |
./bin/zephyrctl customize tester resolved | |
./bin/zephyrctl customize tester shorewall | |
./bin/zephyrctl customize tester sudo | |
./bin/zephyrctl customize tester systemd | |
./bin/zephyrctl customize tester users | |
shell: bash | |
tests-tools: | |
name: Integration tests (customize/tools) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.tools == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Execute scripts (1st pass) | |
run: | | |
./bin/zephyrctl customize tester composer | |
./bin/zephyrctl customize tester dig | |
./bin/zephyrctl customize tester gh | |
./bin/zephyrctl customize tester git | |
./bin/zephyrctl customize tester gpg | |
./bin/zephyrctl customize tester mc | |
./bin/zephyrctl customize tester nano | |
./bin/zephyrctl customize tester nmap | |
./bin/zephyrctl customize tester pass-update | |
./bin/zephyrctl customize tester ssh | |
./bin/zephyrctl customize tester tomb | |
shell: bash | |
- name: Execute scripts (2nd pass) | |
run: | | |
./bin/zephyrctl customize tester composer | |
./bin/zephyrctl customize tester dig | |
./bin/zephyrctl customize tester gh | |
./bin/zephyrctl customize tester git | |
./bin/zephyrctl customize tester gpg | |
./bin/zephyrctl customize tester mc | |
./bin/zephyrctl customize tester nano | |
./bin/zephyrctl customize tester nmap | |
./bin/zephyrctl customize tester pass-update | |
./bin/zephyrctl customize tester ssh | |
./bin/zephyrctl customize tester tomb | |
shell: bash | |
tests-post-install: | |
name: Integration tests (post-install) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.post-install == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Compile disk-map | |
run: | | |
# Get where / is mounted | |
partition=$(findmnt --noheadings --output=SOURCE /) | |
# Get disk device file from partition device file | |
device=$(lsblk --noheadings --output PKNAME "${partition}") | |
# Update disk-map | |
sed -i "s@{{ DEVICE }}@${device}@g" profiles/tester/install/disk-maps/github-actions | |
echo Compiled disk-map: | |
cat profiles/tester/install/disk-maps/github-actions | |
- name: Run post-install | |
run: ./bin/zephyrctl post-install live tester github-actions | |
shell: bash | |
tests-remix: | |
name: Integration tests (remix) | |
runs-on: ubuntu-20.04 | |
needs: check | |
if: needs.check.outputs.remix == 'yes' | |
steps: | |
- name: Self checkout | |
uses: actions/checkout@v3 | |
- name: Link profiles | |
run: ln -s example profiles | |
- name: Download Ubuntu Live CD | |
run: wget -O ubuntu.iso --quiet https://releases.ubuntu.com/20.04.5/ubuntu-20.04.5-desktop-amd64.iso | |
- name: Create remix | |
run: ./bin/zephyrctl remix ubuntu.iso | |
shell: bash |