-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (60 loc) · 2.11 KB
/
self-test-installation.yaml
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
name: Self test install / extend
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
paths:
- 'tests.d/self-install/**'
- 'commands.d/self-install.sh'
- 'commands.d/self-extend.sh'
pull_request:
paths:
- 'tests.d/self-install/**'
- 'commands.d/self-install.sh'
- 'commands.d/self-extend.sh'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Default to bash
defaults:
run:
shell: bash -o errexit -o nounset -o pipefail -x {0}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
self-test-install:
# We run this job in a container to avoid polluting the host
runs-on: ubuntu-latest
container: ubuntu:latest
steps:
# Install dependencies
- name: Run valet self install && self update && self extend
env:
VALET_CONFIG_ENABLE_COLORS: true
VALET_CONFIG_DISABLE_PROGRESS: true
RUNNING_IN_DOCKER: true
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
# Install dependencies
apt-get update -qq
apt-get install -qq -y curl sudo makepasswd uidmap git 1>/dev/null
# Create the 'me' user with sudo privileges
echo 'me' > /tmp/pw
useradd -m -u 1987 -U -p "$(makepasswd --crypt-md5 --clearfrom=/tmp/pw)" me
echo "me ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/me-sudo
chsh -s /bin/bash me;
# checkout the repository
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
# Runs our tests
- name: Run valet self install && self update && self extend
env:
VALET_CONFIG_ENABLE_COLORS: true
VALET_CONFIG_DISABLE_PROGRESS: true
RUNNING_IN_DOCKER: true
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
chmod +x ./tests.d/self-install/test
./tests.d/self-install/test