-
Notifications
You must be signed in to change notification settings - Fork 6
70 lines (61 loc) · 2.05 KB
/
ci-dots.yaml
File metadata and controls
70 lines (61 loc) · 2.05 KB
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
name: dotfiles CI
env:
NOCONFIRM: "1"
SKIP_PACKAGES: "1"
OFFLINE: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test-dotfiles:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
os: archlinux
container: archlinux:latest
- runner: ubuntu-latest
os: fedora
container: fedora:latest
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container }}
steps:
- name: Install dependencies (Arch Linux)
if: matrix.os == 'archlinux'
run: |
pacman -Syu --noconfirm git curl bash shellcheck git-delta chezmoi
- name: Install dependencies (Fedora)
if: matrix.os == 'fedora'
run: |
dnf install -y git curl bash findutils ShellCheck git-delta chezmoi
- name: Apply dotfiles
timeout-minutes: 5
run: |
chezmoi init --apply --verbose "${{ github.repository }}" --dry-run
- name: Run ShellCheck on scripts
run: |
cd "$(chezmoi source-path)"
find .chezmoiscripts -type f \( -name "*.sh" -o -name "*.sh.tmpl" \) | while read -r script; do
echo "Checking: $script"
if [[ "$script" == *.tmpl ]]; then
chezmoi execute-template < "$script" | \
shellcheck --severity=error -s bash \
-e SC2027 -e SC2086 -e SC2119 -e SC2120 - || exit 1
else
shellcheck --severity=error -s bash \
-e SC2027 -e SC2086 -e SC2119 -e SC2120 "$script" || exit 1
fi
done
- name: Run ShellCheck on library files
run: |
cd "$(chezmoi source-path)"
find .chezmoiscripts/linux/lib -type f -name ".lib-*.sh" | while read -r lib; do
echo "Testing library: $lib"
shellcheck --severity=error -s bash \
-e SC2027 -e SC2086 -e SC2119 -e SC2120 "$lib" || exit 1
done