|
| 1 | +name: Static Analysis |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + push: { branches: master } |
| 5 | + |
| 6 | +jobs: |
| 7 | + static_analysis: |
| 8 | + name: Run shellcheck and shfmt |
| 9 | + |
| 10 | + runs-on: ubuntu-latest |
| 11 | + |
| 12 | + steps: |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + # Rush needed for easy installation of latest shfmt |
| 17 | + - name: Install rush |
| 18 | + run: curl -Ls http://get.dannyb.co/rush/setup | bash |
| 19 | + |
| 20 | + - name: Connect rush repo |
| 21 | + run: rush clone dannyben --shallow --default |
| 22 | + |
| 23 | + - name: Install shfmt |
| 24 | + run: rush get shfmt |
| 25 | + |
| 26 | + # libyaml needed for Ruby's YAML library |
| 27 | + - name: Install OS dependencies |
| 28 | + run: sudo apt-get -y install libyaml-dev |
| 29 | + |
| 30 | + - name: Setup Ruby |
| 31 | + uses: ruby/setup-ruby@v1 |
| 32 | + with: |
| 33 | + ruby-version: '3.1' |
| 34 | + bundler-cache: true |
| 35 | + |
| 36 | + - name: Generate all examples |
| 37 | + run: bundle exec run examples regen |
| 38 | + |
| 39 | + - name: Generate all fixtures |
| 40 | + run: bundle exec run fixtures regen |
| 41 | + |
| 42 | + - name: Run shellcheck tests (examples) |
| 43 | + run: bundle exec run shellcheck examples |
| 44 | + |
| 45 | + - name: Run shellcheck tests (fixtures) |
| 46 | + run: bundle exec run shellcheck fixtures |
| 47 | + |
| 48 | + - name: Run shfmt tests (examples) |
| 49 | + run: bundle exec run shfmt examples |
| 50 | + |
| 51 | + - name: Run shfmt tests (fixtures) |
| 52 | + run: bundle exec run shfmt fixtures |
| 53 | + |
| 54 | + json_schema: |
| 55 | + name: Validate JSON schemas |
| 56 | + |
| 57 | + runs-on: ubuntu-latest |
| 58 | + |
| 59 | + steps: |
| 60 | + - name: Checkout code |
| 61 | + uses: actions/checkout@v4 |
| 62 | + |
| 63 | + # Rush needed for easy installation of check-jsonschema |
| 64 | + - name: Install rush |
| 65 | + run: curl -Ls http://get.dannyb.co/rush/setup | bash |
| 66 | + |
| 67 | + - name: Connect rush repo |
| 68 | + run: rush clone dannyben --shallow --default |
| 69 | + |
| 70 | + - name: Install check-jsonschema |
| 71 | + run: rush get check-jsonschema |
| 72 | + |
| 73 | + # libyaml needed for Ruby's YAML library |
| 74 | + - name: Install OS dependencies |
| 75 | + run: sudo apt-get -y install libyaml-dev |
| 76 | + |
| 77 | + - name: Setup Ruby |
| 78 | + uses: ruby/setup-ruby@v1 |
| 79 | + with: |
| 80 | + ruby-version: '3.1' |
| 81 | + bundler-cache: true |
| 82 | + |
| 83 | + - name: Generate all subjects |
| 84 | + run: bundle exec run examples regen |
| 85 | + |
| 86 | + - name: Run schema tests |
| 87 | + run: bundle exec run schema all |
| 88 | + |
| 89 | + codespell: |
| 90 | + name: Spell check |
| 91 | + |
| 92 | + runs-on: ubuntu-latest |
| 93 | + |
| 94 | + steps: |
| 95 | + - name: Checkout code |
| 96 | + uses: actions/checkout@v4 |
| 97 | + |
| 98 | + - name: Install OS dependencies |
| 99 | + run: sudo apt-get -y install codespell |
| 100 | + |
| 101 | + - name: Run codespell |
| 102 | + run: codespell |
0 commit comments