-
Notifications
You must be signed in to change notification settings - Fork 71
175 lines (139 loc) · 4.9 KB
/
Copy pathtest-unit.yml
File metadata and controls
175 lines (139 loc) · 4.9 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Build and Test
on:
push:
branches:
- "master"
pull_request:
branches:
- master
env:
CLOUDYPAD_BUILD_CORE_IMAGE_TAG: ${{ github.head_ref || 'master' }}
CLOUDYPAD_BUILD_SUNSHINE_IMAGE_TAG: ${{ github.head_ref || 'master' }}
jobs:
unit-test:
name: Unit tests
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: nix develop -c pnpm i
- name: Run standard unit tests
run: nix develop -c task test-unit
build:
name: Build Core container image
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: false
- name: test analytics key match
run: nix develop -c task test-analytics-key-match
- name: Build container image
run: nix develop -c task build-core-container-ci
- name: Smoke test container image
run: nix develop -c task test-container-smoke-test
- name: Push image as dev (master branch only)
if: github.ref == 'refs/heads/master'
run: nix develop -c task build-core-container-push-current-as-dev
build-sunshine:
name: Build Sunshine container image
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
logout: false
- name: Build container image
run: nix develop -c task build-sunshine-container-ci
- name: Push image as dev (master branch only)
if: github.ref == 'refs/heads/master'
run: nix develop -c task build-sunshine-container-push-current-as-dev
test-install:
name: Test install/run Ubuntu
if: "!startsWith(github.head_ref, 'release/')" # Install test will fail on release branch as version won't mach
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Test the install script and cloudypad.sh for current commit
- name: Run install script
shell: bash
run: |
curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/${{ github.sha }}/install.sh | bash
echo " ==== .bashrc content ==="
cat ~/.bashrc
echo " ==== .bashrc content ==="
bash -i -c 'echo $PATH && which cloudypad'
test-install-macos:
name: Test install/run MacOS
if: "!startsWith(github.head_ref, 'release/')" # Install test will fail on release branch as version won't mach
runs-on: "${{ matrix.os }}"
strategy:
matrix:
os:
- macos-14
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Test the install script and cloudypad.sh for current commit
- name: Run install script
shell: sh
env:
# Docker is not available on MacOS runner
CLOUDYPAD_INSTALL_SKIP_DOCKER_CHECK: true
# Force step into thinking it runs with default zsh shell
# to emulate real MacOS experience
SHELL: /bin/zsh
run: |
curl -fsSL https://raw.githubusercontent.com/PierreBeucher/cloudypad/${{ github.sha }}/install.sh | zsh
echo " ==== .zshrc content ==="
cat ~/.zshrc
echo " ==== .zshrc content ==="
zsh -i -c 'echo $PATH && which cloudypad'
test-install-container:
name: Test install/run in containers
if: "!startsWith(github.head_ref, 'release/')" # Install test will fail on release branch as version won't mach
runs-on: ubuntu-22.04
# env:
# # Container do not have a tty, this will ensure script behave appropriately
# CLOUDYPAD_CONTAINER_NO_TTY: true
# # Enable debug logs
# CLOUDYPAD_CLI_LAUNCHER_DEBUG: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Test install.sh script
run: test/shell/test-install.sh
- name: Test cloudypad.sh script
run: test/shell/test-cloudypad.sh
test-flake-package:
name: Test Flake package
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: nix build .#
test-doc-links:
name: Test documentation links
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run documentation link check test
run: nix develop -c task test-doc-links