|
| 1 | +name: Tests |
| 2 | + |
| 3 | +# Controls when the action will run. |
| 4 | +on: |
| 5 | + # Triggers the workflow on push or pull request events but only for the main branch |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | + # Allows you to run this workflow manually from the Actions tab |
| 10 | + workflow_dispatch: |
| 11 | + |
| 12 | +jobs: |
| 13 | + |
| 14 | + tests: |
| 15 | + |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + operating-system: [ubuntu-latest] |
| 19 | + |
| 20 | + runs-on: ${{ matrix.operating-system }} |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v3 |
| 25 | + |
| 26 | + - name: Prepare java |
| 27 | + uses: actions/setup-java@v3 |
| 28 | + with: |
| 29 | + distribution: 'adopt' |
| 30 | + java-version: '11' |
| 31 | + |
| 32 | + - name: Install clojure cli |
| 33 | + uses: DeLaGuardo/setup-clojure@master |
| 34 | + with: |
| 35 | + cli: 1.11.1.1273 |
| 36 | + |
| 37 | + - name: Cache Maven packages |
| 38 | + uses: actions/cache@v3 |
| 39 | + with: |
| 40 | + path: ~/.m2 |
| 41 | + key: ${{ runner.os }}-m2-${{ hashFiles('**/deps.edn') }} |
| 42 | + restore-keys: ${{ runner.os }}-m2 |
| 43 | + |
| 44 | + - name: Execute clojure code |
| 45 | + run: clojure -M:dev:test |
| 46 | + |
| 47 | + check-lint: |
| 48 | + |
| 49 | + strategy: |
| 50 | + matrix: |
| 51 | + operating-system: [ubuntu-latest] |
| 52 | + |
| 53 | + runs-on: ${{ matrix.operating-system }} |
| 54 | + |
| 55 | + steps: |
| 56 | + - name: Checkout |
| 57 | + uses: actions/checkout@v3 |
| 58 | + |
| 59 | + - name: Install clojure cli |
| 60 | + uses: DeLaGuardo/setup-clojure@master |
| 61 | + with: |
| 62 | + cli: 1.11.1.1273 |
| 63 | + |
| 64 | + - name: Setup clojure-lsp |
| 65 | + uses: clojure-lsp/setup-clojure-lsp@v1 |
| 66 | + with: |
| 67 | + clojure-lsp-version: 2023.04.19-12.43.29 |
| 68 | + |
| 69 | + - name: Execute lint checks |
| 70 | + run: | |
| 71 | + clojure-lsp format --dry |
| 72 | + clojure-lsp clean-ns --dry |
| 73 | + clojure-lsp diagnostics |
| 74 | +
|
| 75 | + security: |
| 76 | + |
| 77 | + strategy: |
| 78 | + matrix: |
| 79 | + operating-system: [ubuntu-latest] |
| 80 | + |
| 81 | + runs-on: ${{ matrix.operating-system }} |
| 82 | + |
| 83 | + steps: |
| 84 | + - name: Checkout |
| 85 | + uses: actions/checkout@v3 |
| 86 | + |
| 87 | + - name: Scan |
| 88 | + uses: clj-holmes/clj-holmes-action@main |
| 89 | + with: |
| 90 | + output-type: 'stdout' |
| 91 | + fail-on-result: 'true' |
0 commit comments