Skip to content

Run App Builders during Test Workflow #1

Run App Builders during Test Workflow

Run App Builders during Test Workflow #1

Workflow file for this run

name: Test
on:
pull_request:
branches: ['*']
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
java-package: 'jre+fx'
- name: App Builders Install
run: |
docker pull ghcr.io/sillsdev/app-builders:latest
container_id=$(docker create ghcr.io/sillsdev/app-builders:latest bash)
mkdir $HOME/app-builders
docker cp "$container_id:/" $HOME/app-builders
docker rm "$container_id"
chmod +x $HOME/app-builders/*.sh
java -version
/app-builders/sab.sh -? | head -n 4
- name: NPM Install
run: |
node --version
npm --version
npm i
cd convert
npm i
- name: Run Tests
run: |
WORK_DIR=$(pwd)
for PROGRAM in sab rab; do
echo "Processing projects for $PROGRAM"
mkdir -p "$HOME/projects/$PROGRAM"
PROJECTS= $(jq -r ".${PROGRAM}.projects[]" "test_data/projects/index.json")
for PROJECT in $PROJECTS; do
echo "Processing project: $PROJECT"
PROJECT_DIR="$HOME/projects/${PROGRAM}/${PROJECT%%/*}"
mkdir -p "$PROJECT_DIR"
unzip -q "test_data/projects/$PROJECT" -d "$PROJECT_DIR"
pushd "$PROJECT_DIR" > /dev/null
PROJECT_FILE=$(find . -type -f -name "*.appDef")
echo "PROJECT_FILE=$PROJECT_FILE" >> $GITHUB_ENV
"$HOME/app-builders/${PROGRAM}.sh" -load "$PROJECT_FILE" -build-modern-pwa-data-files -no-save -fp pwa-repo="${WORK_DIR}/data"
npm run test
popd > /dev/null
done
done