Skip to content

Commit

Permalink
Add workaround for systemd in testing environment
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Dye <mrtops03@gmail.com>
  • Loading branch information
ecdye committed Jun 8, 2024
1 parent c2cda58 commit d9f7d11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
cpu: cortex-a7
cpu_info: cpuinfo/raspberrypi_3b
bind_mount_repository: true
import_github_env: true
commands: |
/zram-config/install.bash
/zram-config/test-zram-devices.bash
Expand Down
2 changes: 2 additions & 0 deletions install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ echo "Starting zram-config service"
if [[ "$OS" == "alpine" ]]; then
rc-update add zram-config boot
rc-service zram-config start
else if [[ -n "$GITHUB_ENV" ]]; then # GitHub Actions test environment doesn't have systemd
zram-config start
else
systemctl daemon-reload
systemctl enable --now zram-config.service
Expand Down
4 changes: 4 additions & 0 deletions uninstall.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ if [[ $OS == "alpine" ]]; then
fi
rm -f /etc/init.d/zram-config
rm -f /usr/sbin/zram-config
else if [[ -n "$GITHUB_ENV" ]]; then
rm -f /etc/systemd/system/zram-config.service
sed -i '\|^ReadWritePaths=/usr/local/share/zram-config/log$|d' /lib/systemd/system/logrotate.service
rm -f /usr/local/sbin/zram-config
else
systemctl disable zram-config.service
rm -f /etc/systemd/system/zram-config.service
Expand Down

0 comments on commit d9f7d11

Please sign in to comment.