-
Notifications
You must be signed in to change notification settings - Fork 70
135 lines (110 loc) · 3.03 KB
/
test.yaml
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
name: Main workflow
on:
pull_request:
push:
schedule:
- cron: '17 14 * * *'
jobs:
test:
strategy:
fail-fast: false
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Install dependencies
run: |
uname -a
sudo apt-get update
sudo apt-get install expect mergerfs
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run tests
run: |
sudo ./setup.sh
scripts/run_tests.sh
- name: Upload script
uses: actions/upload-artifact@v2
with:
name: try
path: try
manpage:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Install pandoc
run: |
sudo apt-get update
sudo apt-get install pandoc
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Build manpage
run: make -C man
- name: Upload script
uses: actions/upload-artifact@v2
with:
name: try.1
path: man/try.1
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run scripts/lint.sh
run: scripts/lint.sh
version-check:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Check version in script against manpage
run: |
SCRIPT_VERSION=$(grep 'TRY_VERSION=' try | cut -d'"' -f 2)
MANPAGE_VERSION=$(grep 'TRY(1)' docs/try.1.md | cut -d' ' -f 4)
echo "SCRIPT_VERSION = '$SCRIPT_VERSION'"
echo "MANPAGE_VERSION = '$MANPAGE_VERSION'"
[ "$SCRIPT_VERSION" = "$MANPAGE_VERSION" ]
shellcheck:
name: 'Run ShellCheck'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
ignore_paths: >-
completions
prerelease:
needs:
- test
- manpage
- version-check
- lint
- shellcheck
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Download binaries
uses: actions/download-artifact@v2
- name: Collect artifacts
run: |
mv try.1/try.1 try/try.1
- name: Deploy 'latest' release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest script and manpage"
files: |
try/*