From 286da668dd9107c2170a5f70e1e091abf9023fab Mon Sep 17 00:00:00 2001 From: Sergey Gulin Date: Fri, 1 Sep 2023 17:08:57 +0300 Subject: [PATCH] [OPS-1448] Replace buildkite with github actions Problem: The current buildkite-based ci is being replaced with github actions. Solution: Add github ci config, remove buildkite config. --- .buildkite/pipeline.yml | 44 ---------------------- .github/workflows/check.yml | 73 +++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 44 deletions(-) delete mode 100644 .buildkite/pipeline.yml create mode 100644 .github/workflows/check.yml diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml deleted file mode 100644 index 85c8188..0000000 --- a/.buildkite/pipeline.yml +++ /dev/null @@ -1,44 +0,0 @@ -# SPDX-FileCopyrightText: 2022 Serokell -# -# SPDX-License-Identifier: MPL-2.0 - -steps: - - label: check trailing whitespaces - command: nix build -L .#checks.x86_64-linux.trailing-whitespace - - - label: shellcheck - command: nix build -L .#checks.x86_64-linux.shellcheck - - - label: validate cabal files - command: nix develop .#ci -c ./scripts/validate-cabal-files.sh - - - label: stylish - command: nix build -L .#checks.x86_64-linux.stylish-haskell - soft_fail: - - exit_status: 1 - - - label: lint - command: nix build -L .#checks.x86_64-linux.hlint - - - label: build - key: build - command: nix build -L .#checks.x86_64-linux.build-all - - - label: tests - depends_on: build - commands: - - nix build -L .#checks.x86_64-linux.test - - nix develop .#doctest -c runghc doctest/doctests.hs - - - label: xrefcheck - command: nix run github:serokell/xrefcheck - - - label: REUSE lint - command: nix build -L .#checks.x86_64-linux.reuse-lint - - # wait for all checks to finish - - wait - - - label : deploy staging - command: nix develop .#ci -c deploy .#staging --ssh-user deploy --skip-checks - branches: staging diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..1aed6df --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,73 @@ +# SPDX-FileCopyrightText: 2022 Serokell +# +# SPDX-License-Identifier: MPL-2.0 + +name: CI + +on: + push: + +jobs: + validate: + runs-on: [self-hosted, nix] + steps: + - uses: actions/checkout@v3 + + - name: check trailing whitespaces + run: nix build -L .#checks.x86_64-linux.trailing-whitespace + + - name: shellcheck + run: nix build -L .#checks.x86_64-linux.shellcheck + if: success() || failure() + + - name: validate cabal files + run: nix develop .#ci -c ./scripts/validate-cabal-files.sh + if: success() || failure() + + - name: stylish + run: nix build -L .#checks.x86_64-linux.stylish-haskell + if: success() || failure() + + - name: lint + run: nix build -L .#checks.x86_64-linux.hlint + if: success() || failure() + + # not working for unknown reason (OPS-1487) + # - name: xrefcheck + # run: nix run github:serokell/xrefcheck + # if: success() || failure() + + - name: REUSE lint + run: nix build -L .#checks.x86_64-linux.reuse-lint + if: success() || failure() + + build: + runs-on: [self-hosted, nix] + steps: + - uses: actions/checkout@v3 + + - name: build + run: nix build -L .#checks.x86_64-linux.build-all + + test: + runs-on: [self-hosted, nix] + needs: [build] + steps: + - uses: actions/checkout@v3 + + - name: test + run: nix build -L .#checks.x86_64-linux.test + + - name: doctest + run: nix develop .#doctest -c runghc doctest/doctests.hs + if: success() || failure() + + deploy: + runs-on: [self-hosted, nix] + needs: [test] + if: ${{ github.ref == 'refs/heads/staging' }} + steps: + - uses: actions/checkout@v3 + + - name: deploy staging + run: nix develop .#ci -c deploy .#staging --ssh-user deploy --skip-checks