-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: mplementing new workflow using kash repository
- Loading branch information
1 parent
997f19b
commit 2651c12
Showing
5 changed files
with
102 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Run tests | ||
on: | ||
push: | ||
branches: | ||
- gha | ||
jobs: | ||
run_tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node: [ 16 ] | ||
mongo: [ 4 ] | ||
# node: [ 16, 18, 20 ] | ||
# mongo: [ 4, 5, 6 ] | ||
name: Tests / Node ${{ matrix.node }} / Mongo ${{ matrix.mongo }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
# - name: Cache requirements | ||
# uses: actions/cache@v4 | ||
# with: | ||
# key: requirements | ||
# path: ${{ runner.temp }}/dl | ||
# - name: Get yarn cache directory path | ||
# id: yarn-cache-dir-path | ||
# run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
# - uses: actions/cache@v4 | ||
# with: | ||
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
- name: Init runner | ||
run: bash ./scripts/init_runner.sh ${{ github.job }} | ||
- name: Setup workspace | ||
env: | ||
GITHUB_DEVELOPMENT_PAT: ${{ secrets.GH_DEVELOPMENT_PAT }} | ||
run: bash ./scripts/setup_workspace.sh -k klifull -n ${{ matrix.node }} | ||
- name: Run tests | ||
env: | ||
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }} | ||
run: bash ./scripts/run_tests.sh -n ${{ matrix.node }} -m ${{ matrix.mongo }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "scripts/kash"] | ||
path = scripts/kash | ||
url = https://github.com/kalisio/kash.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
# set -x | ||
|
||
THIS_FILE=$(readlink -f "${BASH_SOURCE[0]}") | ||
THIS_DIR=$(dirname "$THIS_FILE") | ||
ROOT_DIR=$(dirname "$THIS_DIR") | ||
|
||
. "$THIS_DIR/kash/kash.sh" | ||
|
||
## Parse options | ||
## | ||
|
||
NODE_VER=16 | ||
MONGO_VER=4 | ||
while getopts "m:n:" option; do | ||
case $option in | ||
m) # defines mongo version | ||
MONGO_VER=$OPTARG;; | ||
n) # defines node version | ||
NODE_VER=$OPTARG;; | ||
*) | ||
;; | ||
esac | ||
done | ||
|
||
## Init workspace | ||
## | ||
|
||
WORKSPACE_DIR="$(dirname "$ROOT_DIR")" | ||
init_app_infos "$ROOT_DIR" "$WORKSPACE_DIR/development/workspaces/apps" | ||
|
||
APP=$(get_app_name) | ||
VERSION=$(get_app_version) | ||
FLAVOR=$(get_app_flavor) | ||
|
||
echo "About to run tests for ${APP} v${VERSION}-($FLAVOR) ..." | ||
|
||
. "$WORKSPACE_DIR/development/workspaces/apps/apps.sh" kapp | ||
|
||
## Start mongo | ||
## | ||
|
||
begin_group "Starting mongo $MONGO_VER ..." | ||
|
||
use_mongo "$MONGO_VER" | ||
k-mongo | ||
|
||
end_group "Starting mongo $MONGO_VER ..." | ||
|
||
## Run tests | ||
## | ||
|
||
use_node "$NODE_VER" | ||
yarn test |