-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (63 loc) · 1.84 KB
/
ubuntu.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
67
68
69
70
71
72
name: Ubuntu
on:
push:
branches: [main]
paths-ignore:
- "README.md"
- "Makefile"
- "Dockerfile"
- "install/macos/**"
- ".chezmoiscripts/macos/**"
- "dot_tmux.conf.d/os/macos.conf"
- "tests/install/macos/**"
pull_request:
branches: [main]
paths-ignore:
- "README.md"
- "Makefile"
- "Dockerfile"
- "install/macos/**"
- ".chezmoiscripts/macos/**"
- "dot_tmux.conf.d/os/macos.conf"
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
strategy:
matrix:
system: [server, client]
runs-on: ubuntu-latest
steps:
- name: Setup dotfiles
env:
SYSTEM: ${{ matrix.system }}
DOTFILES_DEBUG: 1
EVENT_NAME: ${{ github.event_name }}
run: |
if [ "${EVENT_NAME}" == "push" ]; then
BRANCH_NAME="${{ github.ref_name }}"
elif [ "${EVENT_NAME}" == "pull_request" ]; then
BRANCH_NAME="${{ github.head_ref }}"
fi
export BRANCH_NAME
URL="https://raw.githubusercontent.com/pragmaticivan/dotfiles/${BRANCH_NAME}/setup.sh"
echo "Download setup.sh from ${URL}"
printf '${SYSTEM}\n' | bash -c "$(wget -qO - $URL)"
- name: Install latest bats-core
run: |
tmp_dir=$(mktemp -d /tmp/bats-core-XXXXX)
git clone --depth 1 https://github.com/bats-core/bats-core.git "${tmp_dir}"
cd "${tmp_dir}"
sudo ./install.sh /usr/local
rm -rf "${tmp_dir}"
- name: Test file existence
env:
SYSTEM: ${{ matrix.system }}
run: |
cd $(chezmoi source-path)/../
bats tests/files/common.bats
bats --filter-tags common,ubuntu:${SYSTEM} \
--print-output-on-failure \
tests/files/ubuntu.bats