|
| 1 | +# SPDX-FileCopyrightText: 2022 Serokell <https://serokell.io> |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: MPL-2.0 |
| 4 | + |
| 5 | +name: CI |
| 6 | + |
| 7 | +on: |
| 8 | + push: |
| 9 | + |
| 10 | +jobs: |
| 11 | + validate: |
| 12 | + runs-on: [self-hosted, nix] |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v3 |
| 15 | + |
| 16 | + - name: check trailing whitespaces |
| 17 | + run: nix build -L .#checks.x86_64-linux.trailing-whitespace |
| 18 | + |
| 19 | + - name: shellcheck |
| 20 | + run: nix build -L .#checks.x86_64-linux.shellcheck |
| 21 | + if: success() || failure() |
| 22 | + |
| 23 | + - name: validate cabal files |
| 24 | + run: nix develop .#ci -c ./scripts/validate-cabal-files.sh |
| 25 | + if: success() || failure() |
| 26 | + |
| 27 | + - name: stylish |
| 28 | + run: nix build -L .#checks.x86_64-linux.stylish-haskell |
| 29 | + if: success() || failure() |
| 30 | + |
| 31 | + - name: lint |
| 32 | + run: nix build -L .#checks.x86_64-linux.hlint |
| 33 | + if: success() || failure() |
| 34 | + |
| 35 | + # not working for unknown reason (OPS-1487) |
| 36 | + # - name: xrefcheck |
| 37 | + # run: nix run github:serokell/xrefcheck |
| 38 | + # if: success() || failure() |
| 39 | + |
| 40 | + - name: REUSE lint |
| 41 | + run: nix build -L .#checks.x86_64-linux.reuse-lint |
| 42 | + if: success() || failure() |
| 43 | + |
| 44 | + build: |
| 45 | + runs-on: [self-hosted, nix] |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v3 |
| 48 | + |
| 49 | + - name: build |
| 50 | + run: nix build -L .#checks.x86_64-linux.build-all |
| 51 | + |
| 52 | + test: |
| 53 | + runs-on: [self-hosted, nix] |
| 54 | + needs: [build] |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v3 |
| 57 | + |
| 58 | + - name: test |
| 59 | + run: nix build -L .#checks.x86_64-linux.test |
| 60 | + |
| 61 | + - name: doctest |
| 62 | + run: nix develop .#doctest -c runghc doctest/doctests.hs |
| 63 | + if: success() || failure() |
| 64 | + |
| 65 | + deploy: |
| 66 | + runs-on: [self-hosted, nix] |
| 67 | + needs: [test] |
| 68 | + if: ${{ github.ref == 'refs/heads/staging' }} |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v3 |
| 71 | + |
| 72 | + - name: deploy staging |
| 73 | + run: nix develop .#ci -c deploy .#staging --ssh-user deploy --skip-checks |
0 commit comments