-
-
Notifications
You must be signed in to change notification settings - Fork 22
executable file
·99 lines (99 loc) · 3.15 KB
/
dorothy-workflow.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
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
name: dorothy-workflow
'on':
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
env:
DOROTHY: ${{ github.workspace }}/.local/share/dorothy
VERBOSE: yes
CI_COMMIT_MESSAGE: 'ci: adjustments'
CI_COMMIT_NAME: 'Continuous Integration'
CI_COMMIT_EMAIL: '[email protected]'
steps:
- name: 'Cache XDG'
id: cache-xdg
uses: actions/cache@v3
with:
path: ~/.local
key: ${{ runner.os }}
- name: 'Checkout'
uses: actions/checkout@v2
with:
path: ${{ env.DOROTHY }}
- name: 'Dorothy Development'
shell: bash
run: |
echo "HOME = ${HOME-}"
echo "XDG_DATA_HOME = ${XDG_DATA_HOME-}"
echo "DOROTHY = ${DOROTHY-}"
chmod +x "$DOROTHY/commands/"*
DOROTHY_LOAD=yes
DOROTHY_LOADED=no
source '$DOROTHY/init.sh'
dorothy dev
- name: 'Trunk Format'
if: github.event_name == 'push'
shell: bash
run: |
source "$DOROTHY/sources/login.sh"
dorothy format || :
if git diff --quiet &>/dev/null; then
echo 'Already formatted.'
else
git config --global user.name "${{ env.CI_COMMIT_NAME }}"
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
git commit -a -m "${{ env.CI_COMMIT_MESSAGE }}"
git push
fi
- name: 'Trunk Check'
uses: trunk-io/trunk-action@v1
- name: 'Dorothy Test'
shell: 'script -q -e -c "bash {0}"'
run: |
source "$DOROTHY/sources/login.sh"
dorothy test
distros:
continue-on-error: true
runs-on: ubuntu-latest
strategy:
matrix:
container:
- 'ubuntu:latest' # https://hub.docker.com/_/ubuntu
- 'fedora:latest' # https://hub.docker.com/_/fedora
- 'debian:latest' # https://hub.docker.com/_/debian
- 'alpine:latest' # https://hub.docker.com/_/alpine
- 'manjarolinux/base' # https://hub.docker.com/r/manjarolinux/base
- 'archlinux:latest' # https://hub.docker.com/_/archlinux
- 'opensuse/leap' # https://hub.docker.com/r/opensuse/leap
container:
image: ${{ matrix.container }}
env:
VERBOSE: 'yes'
steps:
- name: 'Dorothy Dependencies'
run: |
if command -v apt-get; then
# for ubuntu
apt-get update
apt-get install -y bash curl
elif command -v apk; then
# for alpine
apk add bash curl
elif command -v zypper; then
# for opensuse
zypper install -y --no-recommends bash curl
elif command -v pamac; then
# for manjaro
pamac install --no-confirm bash curl
elif command -v pacman; then
# for arch besides manjaro
pacman -S --needed --noconfirm bash curl
elif command -v yum; then
# for fedora
yum install -y bash curl
fi
- name: 'Dorothy Remote Tests'
run: |
bash -xvic "$(curl -fsSL https://dorothy.bevry.me/commands/dorothy)" -- test