64a7f6b38833d007394b9b4bf5d17e48db77c0d7

Author
Modded Gamers <35778371+ModdedGamers@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

Create Github Action to run tests (#8569)

The published workflow tests the installer and checks the syntax of known zsh files
in the project.

Co-authored-by: Marc Cornellà <marc.cornella@live.com>

Diff

 1diff --git a/.github/workflows/check-suite.yml b/.github/workflows/check-suite.yml
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..3a7ad354d6aba97b4ab9c9808316870221f785db
 4--- /dev/null
 5+++ b/.github/workflows/check-suite.yml
 6@@ -0,0 +1,36 @@
 7+name: Check Suite
 8+on:
 9+  pull_request:
10+    types:
11+      - opened
12+      - synchronize
13+    branches:
14+      - master
15+  push:
16+    branches: 
17+      - master
18+
19+jobs:
20+  tests:
21+    name: Run tests
22+    runs-on: ${{ matrix.os }}
23+    strategy:
24+      matrix:
25+        os: [ubuntu-latest, macos-latest]
26+    steps:
27+      - name: Set up git repository
28+        uses: actions/checkout@v2
29+      - name: Install zsh
30+        if: runner.os == 'Linux'
31+        run: sudo apt-get update; sudo apt-get install zsh
32+      - name: Test installer
33+        run: sh ./tools/install.sh
34+      - name: Check syntax
35+        run: |
36+          for file in ./oh-my-zsh.sh \
37+                      ./lib/*.zsh \
38+                      ./plugins/*/*.plugin.zsh \
39+                      ./plugins/*/_* \
40+                      ./themes/*.zsh-theme; do
41+            zsh -n "$file" || return 1
42+          done
43diff --git a/README.md b/README.md
44index 291fb512b422358476579d26df7eff28792cfd36..fddc7c2417d840d80dcc9092ec727bd2d2f82154 100644
45--- a/README.md
46+++ b/README.md
47@@ -14,6 +14,7 @@ Finally, you'll begin to get the sort of attention that you have always felt you
48 
49 To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on Discord.
50 
51+![Check Suite](https://github.com/ohmyzsh/ohmyzsh/workflows/Check%20Suite/badge.svg)
52 [![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
53 [![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
54