-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (50 loc) · 1.41 KB
/
test.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
name: Test
on:
push:
branches:
- main
pull_request:
jobs:
test:
name: template setup test
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run Template Setup
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
./setup.bash \
"@foo/bar_tool" \
"bar_tool" \
"username" \
"author name" \
"username/bar_tool" \
"master" \
"Apache-2.0" \
"yes"
- name: Check setup result
run: |
error() {
printf "\033[0;31m %s \033[0m \n" "$1"
exit 1
}
set -xe
ls -la .
git log
test ! -d template/ || error "Template Directory Exists"
grep "Apache" LICENSE || error "License Not Found"
test "master" = "$(git rev-parse --abbrev-ref HEAD)" || error "Not on master branch"
! git grep -F \
-e "<PACKAGE NAME>" \
--or -e "<PACKAGE REPO>" \
--or -e "<YOUR NAME>" \
--or -e "<PRIMARY BRANCH>" \
--or -e "<YOUR GITHUB USERNAME>" \
|| error "Template Placeholders Still Exist"