Skip to content

Commit

Permalink
Feat: add GitHub actions (#8)
Browse files Browse the repository at this point in the history
* feat: add github workflow to run test.sh after every commit

* add lint for plugin and shell in workflow

* remove shell setup step - redundent

* fix: ensure correct exit codes in .ci/ scripts

---------

Co-authored-by: Navin Chandra <[email protected]>
  • Loading branch information
pearguacamole and navin772 authored Oct 22, 2024
1 parent 5e15d84 commit 6b7f0ec
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .ci/lint-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ REPO_DIR=$(git rev-parse --show-toplevel)
pushd "${REPO_DIR}" >/dev/null

docker run \
-it \
--rm \
-v "$(pwd):/plugin" \
buildkite/plugin-linter \
--id lambdatest/lambdatest

EXIT_CODE=$?

popd >/dev/null

exit $EXIT_CODE
4 changes: 4 additions & 0 deletions .ci/lint-shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ docker run \
--rm \
koalaman/shellcheck hooks/*

EXIT_CODE=$?

popd >/dev/null

exit $EXIT_CODE
6 changes: 5 additions & 1 deletion .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ REPO_DIR=$(git rev-parse --show-toplevel)

pushd "${REPO_DIR}" >/dev/null

docker-compose run --rm tests
docker compose run --rm tests

EXIT_CODE=$?

popd >/dev/null

exit $EXIT_CODE
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint-plugin:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Lint for plugins
run: .ci/lint-plugin.sh

lint-shell:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Lint for shell
run: .ci/lint-shell.sh

test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run test.sh
run: .ci/test.sh

0 comments on commit 6b7f0ec

Please sign in to comment.