Skip to content

Commit

Permalink
wip: build_app workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed Feb 16, 2024
1 parent 7985d09 commit b113160
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build_app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build app
on:
push:
branches:
- gha
jobs:
build_app:
name: Build app
runs-on: ubuntu-22.04
# container:
# image: harbor.portal.kalisio.com/kalisio/ci-kdk:latest
# # Run using Github Actions specific user in our container
# options: --user 1001
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: Run tests
env:
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_KEY }}
GITHUB_DEVELOPMENT_PAT: ${{ secrets.GH_DEVELOPMENT_PAT }}
run: bash ./scripts/build_app.sh
39 changes: 39 additions & 0 deletions scripts/build_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,42 @@ THIS_PATH=$(dirname "$THIS_FILE")
ROOT_PATH=$(dirname "$THIS_PATH")

. "$THIS_PATH/kash/kash.sh"

if [ "$CI" = true ]; then
begin_group "Fetching project dependencies ..."

WORKSPACE_DIR="$(dirname "$ROOT_PATH")"
DEVELOPMENT_REPO_DIR="$WORKSPACE_DIR/development"

# Workaround since repo is kApp with a 'A' and in kli file it's kapp with a 'a'
ln -s "$WORKSPACE_DIR/kApp" "$WORKSPACE_DIR/kapp"

# clone developement
git clone --depth 1 "https://$GITHUB_DEVELOPMENT_PAT@github.com/kalisio/development.git" "$DEVELOPMENT_REPO_DIR"

get_app_infos "$ROOT_PATH" "$DEVELOPMENT_REPO_DIR/workspaces/apps"
APP="${APP_INFOS[0]}"
VERSION="${APP_INFOS[1]}"
FLAVOR="${APP_INFOS[2]}"
KLI_FILE="${APP_INFOS[3]}"

run_kli "$WORKSPACE_DIR" "$KLI_FILE" 16

end_group "Fetching project dependencies ..."

echo "Used kli file $KLI_FILE ..."
echo "About to build app ${APP}@${VERSION} ($FLAVOR) ..."
else
DEVELOPMENT_REPO_DIR="$KALISIO_DEVELOPMENT_DIR/development"
fi

## Load project env
##

. "$DEVELOPMENT_REPO_DIR/workspaces/apps/apps.sh" kapp

## Build app
##

use_node 16
yarn pwa:build

0 comments on commit b113160

Please sign in to comment.