## Description - Added ci-debugging.yml to enable local debugging - Modularised docker image building with build-docker-image.yml ## Type of change - ci-debugging.yml - build-docker-image.yml ## How Has This Been Tested? - Manual ## Checklist: ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test
151 lines
4.6 KiB
YAML
151 lines
4.6 KiB
YAML
name: CI Debugging
|
|
|
|
on:
|
|
# This line enables manual triggering of this workflow.
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
server-build:
|
|
name: server-build
|
|
uses: ./.github/workflows/server-build.yml
|
|
secrets: inherit
|
|
with:
|
|
pr: ${{ github.event.client_payload.pull_request.number }}
|
|
|
|
client-build:
|
|
name: client-build
|
|
uses: ./.github/workflows/client-build.yml
|
|
secrets: inherit
|
|
with:
|
|
pr: ${{ github.event.client_payload.pull_request.number }}
|
|
|
|
rts-build:
|
|
name: rts-build
|
|
uses: ./.github/workflows/rts-build.yml
|
|
secrets: inherit
|
|
with:
|
|
pr: ${{ github.event.client_payload.pull_request.number }}
|
|
|
|
build-docker-image:
|
|
needs: [ client-build, server-build, rts-build ]
|
|
# Only run if the build step is successful
|
|
if: success()
|
|
name: build-docker-image
|
|
uses: ./.github/workflows/build-docker-image.yml
|
|
secrets: inherit
|
|
with:
|
|
pr: ${{ github.event.client_payload.pull_request.number }}
|
|
|
|
ci-test:
|
|
needs: [ build-docker-image ]
|
|
# Only run if the build step is successful
|
|
if: success()
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
job: [ 0 ]
|
|
|
|
# Service containers to run with this job. Required for running tests
|
|
services:
|
|
# Label used to access the service container
|
|
redis:
|
|
# Docker Hub image for Redis
|
|
image: redis
|
|
ports:
|
|
# Opens tcp port 6379 on the host and service container
|
|
- 6379:6379
|
|
mongo:
|
|
image: mongo
|
|
ports:
|
|
- 27017:27017
|
|
|
|
steps:
|
|
- name: Set up Depot CLI
|
|
uses: depot/setup-action@v1
|
|
|
|
# Check out merge commit
|
|
- name: Fork based /ok-to-test checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: "refs/pull/${{ github.event.client_payload.pull_request.number }}/merge"
|
|
|
|
# Timestamp will be used to create cache key
|
|
- id: timestamp
|
|
run: echo "timestamp=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
|
|
|
|
# Setup Java
|
|
- name: Set up JDK 17
|
|
if: steps.run_result.outputs.run_result != 'success'
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
|
|
- name: Download Docker image artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: cicontainer
|
|
|
|
- name: Load Docker image from tar file
|
|
run: docker load -i cicontainer.tar
|
|
|
|
- name: Create folder
|
|
if: steps.run_result.outputs.run_result != 'success'
|
|
env:
|
|
APPSMITH_LICENSE_KEY: ${{ secrets.APPSMITH_LICENSE_KEY }}
|
|
working-directory: "."
|
|
run: |
|
|
mkdir -p cicontainerlocal/stacks/configuration/
|
|
|
|
#Download the oldstacks from appsmithorg/oldstacks repo
|
|
- name: Download the oldstack
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: main
|
|
repository: appsmithorg/ci-oldstack
|
|
token: ${{ secrets.APPSMITH_CI_TEST_PAT }}
|
|
submodules: 'recursive'
|
|
path: cicontainerlocal/oldstack
|
|
|
|
- name: Load docker image
|
|
if: steps.run_result.outputs.run_result != 'success'
|
|
env:
|
|
APPSMITH_LICENSE_KEY: ${{ secrets.APPSMITH_LICENSE_KEY }}
|
|
working-directory: "."
|
|
run: |
|
|
sudo /etc/init.d/ssh stop ;
|
|
mkdir -p ~/git-server/keys
|
|
mkdir -p ~/git-server/repos
|
|
docker run --name test-event-driver -d -p 22:22 -p 5001:5001 -p 3306:3306 \
|
|
-p 5432:5432 -p 28017:27017 -p 25:25 -p 5000:5000 -p 3001:3000 --privileged --pid=host --ipc=host --volume /:/host -v ~/git-server/keys:/git-server/keys \
|
|
-v ~/git-server/repos:/git-server/repos appsmith/test-event-driver:latest
|
|
cd cicontainerlocal
|
|
docker run -d --name appsmith -p 80:80 -p 9001:9001 \
|
|
-v "$PWD/stacks:/appsmith-stacks" -e APPSMITH_LICENSE_KEY=$APPSMITH_LICENSE_KEY \
|
|
-e APPSMITH_DISABLE_TELEMETRY=true \
|
|
-e APPSMITH_CLOUD_SERVICES_BASE_URL=http://host.docker.internal:5001 \
|
|
--add-host=host.docker.internal:host-gateway \
|
|
cicontainer
|
|
|
|
- name: Use Node.js 16.14.0
|
|
if: steps.run_result.outputs.run_result != 'success'
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "16.14.0"
|
|
|
|
# Install all the dependencies
|
|
- name: Install dependencies
|
|
if: steps.run_result.outputs.run_result != 'success'
|
|
run: |
|
|
cd app/client
|
|
yarn install
|
|
|
|
# Start tmate session for tunnelling
|
|
- name: Setup tmate session
|
|
if: always()
|
|
uses: mxschmitt/action-tmate@v3
|