-
Notifications
You must be signed in to change notification settings - Fork 53
99 lines (99 loc) · 2.79 KB
/
ci.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
on:
push:
paths-ignore:
- 'docs/**'
branches:
- master
pull_request:
paths-ignore:
- 'docs/**'
name: CI
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Test
run: go test ./...
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Shell check
run: ./bin/lint-shell-scripts
- name: golangci-lint
run: golangci-lint run
packages:
name: Package sanity tests
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
needs:
- it
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Test packages
run: |
cd it/sanity
./run.sh
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Init Hermit
uses: cashapp/activate-hermit@v1
- name: Test
run: make -C docs schema
it:
# The integration tests cannot be run in an active Hermit environment,
# so we don't activate it here.
name: Integration Tests
runs-on: [ ubuntu-latest ]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: geninstaller Cross Check
run: |
BASE_DIST_URL="https://github.com/cashapp/hermit/releases/download"
DEST=$(mktemp)
for i in {1..42}
do
CHANNEL=$(head -c 7 /dev/urandom | xxd -p)
./bin/go run ./cmd/geninstaller --dest="${DEST}" --dist-url=https://github.com/cashapp/hermit/releases/download/"${CHANNEL}"
sum1=$(openssl dgst -sha256 "${DEST}" | awk '{print $NF}')
sum2=$(./bin/go run -ldflags "-X main.channel=${CHANNEL}" ./cmd/hermit gen-installer --dest="${DEST}")
[ "${sum1}" = "${sum2}" ] || exit 1
done
- name: Ensure Up-to-date script.sha256 File
run: |
./it/check_script_sha.sh
- name: Build Hermit
run: |
mkdir build testenv
./bin/go build -o ./build/hermit ./cmd/hermit
- name: Install shells
run: sudo apt-get install zsh
- name: Run Go Integration Tests
run: ./bin/go test -tags integration -v ./integration
- name: Run Shellspec Integration Tests
run: |
export PATH=$PWD/build:$PATH
cd it/full
./run.sh
# - name: Run Backwards Compatibility Integration tests
# run: |
# export PATH=$PWD/build:$PATH
# cd it/compatibility
# ./run.sh