-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (39 loc) · 1.15 KB
/
setup-codespace.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
name: setup-codespace
on:
push:
branches: [ main ]
paths:
- 'script/**'
- '*-Brewfile'
- '.github/workflows/*.yml'
# Run every Saturday at midnight
schedule:
- cron: '0 0 * * 6'
workflow_dispatch:
env:
CODESPACES: true
CODESPACE_NAME: ${{ github.workflow }}-${{ github.job }}-run-${{ github.run_id }}-attempt-${{ github.run_attempt }}
NOTIFICATION_URL: ${{ secrets.NOTIFICATION_URL }}
PUSHOVER_API_TOKEN: ${{ secrets.PUSHOVER_API_TOKEN }}
PUSHOVER_USER_KEY: ${{ secrets.PUSHOVER_USER_KEY }}
jobs:
bootstrap:
runs-on: 'ubuntu-22.04'
steps:
- uses: actions/checkout@v3
- name: Validate syntax
run: |
FAILURE=0
for file in script/*;
do
head -1 $file | grep -q bash && echo $file && bash -O extglob -n $file
# Grep fails out with 1 if it doesn't find the pattern.
# Bash fails out with 2 for syntax issues.
if [[ $? -gt 1 ]]; then
echo "$file failed test"
FAILURE=1
fi
done
exit "$FAILURE"
- name: Run setup script
run: script/setup "TEST_HOSTNAME"