-
Notifications
You must be signed in to change notification settings - Fork 6
112 lines (102 loc) · 5.27 KB
/
builds.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
name: docker build
# on: [push]
on:
push:
paths:
- 'usr/bin/dist-installer-cli'
- '.github/workflows/builds.yml'
jobs:
changes:
runs-on: ubuntu-22.04
permissions:
pull-requests: read
outputs:
builds: ${{ steps.filter.outputs.builds }}
installer: ${{ steps.filter.outputs.installer }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
installer:
- 'usr/bin/dist-installer-cli'
builds:
- '.github/workflows/builds.yml'
build:
needs: changes
# if: ${{ (needs.changes.outputs.installer == 'true') }}
# if: ${{ (needs.changes.outputs.builds == 'true') }}
if: ${{ (needs.changes.outputs.installer == 'true' || needs.changes.outputs.builds == 'true') }}
## Github takes too long to set the current latest image, this is
## why we set it manually.
## https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- image: fedora:latest
- image: debian:oldstable
- image: debian:stable
- image: debian:testing
- image: debian:unstable
- image: ubuntu:latest
- image: linuxmintd/mint21.2-amd64:latest
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v3
- name: System Basic Packages
run: |
if command -v apt-get; then
apt-get update -y && apt-get install -y shellcheck sudo adduser tor
elif command -v dnf; then
dnf update -y && dnf install -y ShellCheck sudo tor
else
exit 1
fi
- name: System information
run: |
cat /etc/os-release
uname -a
echo "${PATH}"
cat /etc/sudoers
ls /etc/sudoers.d
- name: Normal user with sudo privileges
run: |
if test -f /etc/debian_version; then
## Debian trixie needs "--comment".
## Older Debian versions need "--gecos".
adduser --comment "" --disabled-password user || adduser --gecos "" --disabled-password user
usermod -aG sudo user
echo "%sudo ALL=(ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/user
elif test -f /etc/fedora-release; then
adduser user
usermod -aG wheel user
echo "%wheel ALL=(ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/user
else
exit 1
fi
- name: Run default dist-installer-cli - Clearnet
run: sudo -u user -- usr/bin/dist-installer-cli --non-interactive --log-level=debug --no-boot --dev --ci
- name: Run default dist-installer-cli - Onion
run: sudo -u user -- usr/bin/dist-installer-cli --non-interactive --log-level=debug --no-boot --dev --ci --onion
- name: Run VirtualBox Installer - default repository - Clearnet
run: sudo -u user -- usr/bin/dist-installer-cli --non-interactive --log-level=debug --no-boot --dev --ci --virtualbox-only
- name: Run VirtualBox Installer - default repository - Onion
run: sudo -u user -- usr/bin/dist-installer-cli --non-interactive --log-level=debug --no-boot --dev --ci --virtualbox-only --onion
- name: Run VirtualBox Installer - Oracle repository - Clearnet
run: sudo -u user -- usr/bin/dist-installer-cli --non-interactive --log-level=debug --no-boot --dev --ci --virtualbox-only --oracle-repo
- name: Run VirtualBox Installer - Oracle repository - Onion
- run: sudo -u user -- usr/bin/dist-installer-cli --non-interactive --log-level=debug --no-boot --dev --ci --virtualbox-only --oracle-repo --onion
- name: Run VirtualBox Installer - back to default repository
run: sudo -u user -- usr/bin/dist-installer-cli --non-interactive --log-level=debug --no-boot --dev --ci --virtualbox-only
- name: Run VirtualBox Installer - back to default repository - Clearnet
run: sudo -u user -- usr/bin/dist-installer-cli --non-interactive --log-level=debug --no-boot --dev --ci --virtualbox-only --onion
## When `source`d the script should exit in less than a second because it should not perform actual work.
## If it was running longer that would mean that it can no longer be `source`d without actually running.
- name: Run Bash to test 'source'ing the script
run: sudo -u user -- timeout 5 bash -c "set -x && source usr/bin/dist-installer-cli"
- name: Run Installer ShellCheck
run: shellcheck usr/bin/dist-installer-cli