main.yml 1008 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: CI
  2. on:
  3. pull_request:
  4. types:
  5. - opened
  6. - synchronize
  7. branches:
  8. - master
  9. push:
  10. branches:
  11. - master
  12. concurrency:
  13. group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  14. cancel-in-progress: true
  15. permissions:
  16. contents: read # to fetch code (actions/checkout)
  17. jobs:
  18. tests:
  19. name: Run tests
  20. runs-on: ${{ matrix.os }}
  21. if: github.repository == 'ohmyzsh/ohmyzsh'
  22. strategy:
  23. matrix:
  24. os: [ubuntu-latest, macos-latest]
  25. steps:
  26. - name: Set up git repository
  27. uses: actions/checkout@v3
  28. - name: Install zsh
  29. if: runner.os == 'Linux'
  30. run: sudo apt-get update; sudo apt-get install zsh
  31. - name: Check syntax
  32. run: |
  33. for file in ./oh-my-zsh.sh \
  34. ./lib/*.zsh \
  35. ./plugins/*/*.plugin.zsh \
  36. ./plugins/*/_* \
  37. ./themes/*.zsh-theme; do
  38. zsh -n "$file" || return 1
  39. done