-
Notifications
You must be signed in to change notification settings - Fork 2
100 lines (81 loc) · 2.29 KB
/
Copy pathci.yml
File metadata and controls
100 lines (81 loc) · 2.29 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
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y zip unzip shc
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: brew install bash zip shc
- name: Verify bash version
run: bash --version
- name: Build dotbak (native binary)
run: ./build.sh
- name: Verify build
run: |
file dotbak
./dotbak --version
./dotbak --help
- name: Run test suite
run: ./test.sh
- name: Upload test results (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: |
/tmp/dotbak-test.*
retention-days: 3
shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ShellCheck
run: sudo apt-get install -y shellcheck
- name: Run ShellCheck on source files
run: |
shellcheck -S warning \
src/core/*.sh \
src/utils/*.sh \
src/commands/*.sh \
src/main.sh \
src/load_modules.sh \
build.sh \
install.sh \
uninstall.sh
- name: Run ShellCheck on bash completions
run: shellcheck -S warning completions/bash/dotbak
build-check:
name: Build Reproducibility
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: ./build.sh
- name: Check binary is executable and self-consistent
run: |
test -x dotbak
version=$(./dotbak --version | awk '{print $2}')
expected=$(cat VERSION | tr -d '[:space:]')
echo "Binary version: $version"
echo "VERSION file: $expected"
test "$version" = "$expected"