-
Notifications
You must be signed in to change notification settings - Fork 144
executable file
·60 lines (60 loc) · 2.13 KB
/
main.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
name: Checks
on:
push:
branches:
- 'master'
paths-ignore:
- '*.md'
pull_request:
branches:
- 'master'
paths-ignore:
- '*.md'
jobs:
test:
strategy:
matrix:
platform: [ubuntu-18.04, macos-latest]
name: Installation test on ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
if: "!contains(github.event.head_commit.message, '[SKIP-CI]')"
steps:
- name: Check out code
uses: actions/checkout@v1
- uses: dorny/paths-filter@v2.2.0
id: filter
with:
filters: |
install:
- 'install.sh'
- name: 'Install Google drive upload'
if: steps.filter.outputs.install == 'true'
run: |
set -e
sh install.sh
PATH="${HOME}/.google-drive-upload/bin:${PATH}"
gupload --info && gsync --help | head -n 10
sh install.sh -U && sh install.sh --posix -B master
gupload --info && gsync --help | head -n 10
sh install.sh -U && sh install.sh -c custom_gupload -sc custom_gsync
custom_gupload --info && custom_gsync --help | head -n 10
- name: 'Format and merge test'
run: |
set -e
PATH="${HOME}/.shellcheck:${PATH}"
mkdir -p "${HOME}/.shellcheck"
case "$(uname -s)" in
Darwin)
wget -q https://github.com/koalaman/shellcheck/releases/download/v0.8.0/shellcheck-v0.8.0.darwin.x86_64.tar.xz -O shl.xz
;;
Linux)
wget -q https://github.com/koalaman/shellcheck/releases/download/v0.8.0/shellcheck-v0.8.0.linux.x86_64.tar.xz -O shl.xz
;;
esac
tar -xf shl.xz
mv shellcheck*/shellcheck "${HOME}/.shellcheck/"
rm -rf shl.xz shellcheck*
{ { command -v apt-get && sudo apt-get install snapd -yqq && sudo snap install shfmt ;} ||
{ command -v brew && brew install shfmt ;} ;} 2>| /dev/null 1>&2
sh release.sh
{ [ -n "$(git diff)" ] && printf "%s\n" "Error: Format scripts and run merge.sh before pushing the commits." && git diff && exit 1 ;} || :