Run App Builders during Test Workflow #12
Workflow file for this run
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
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: 'jdk' | |
- uses: ConorMacBride/install-package@v1 | |
with: | |
apt: openjfx libopenjfx-jni | |
- 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 | |
$HOME/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 dab; do | |
echo "Processing projects for $PROGRAM" | |
mkdir -p "$HOME/projects/$PROGRAM" | |
PROJECTS=$(jq -r ".${PROGRAM}.projects[]" "test_data/projects/index.json") | |
echo "PROJECTS=$PROJECTS" | |
for PROJECT_ZIP in $PROJECTS; do | |
PROJECT_NAME=$(basename "$PROJECT_ZIP" .zip) | |
echo "Processing project: $PROJECT_NAME" | |
PROJECT_DIR="$HOME/projects/${PROGRAM}/$PROJECT_NAME" | |
echo "PROJECT_DIR=${PROJECT_DIR}" | |
mkdir -p "$PROJECT_DIR" | |
unzip -q "test_data/projects/${PROGRAM}/$PROJECT_ZIP" -d "$PROJECT_DIR" | |
npm run clean:all | |
pushd "$PROJECT_DIR" > /dev/null | |
PROJECT_FILE=$(find . -type f -name "*.appDef") | |
echo "PROJECT_FILE=$PROJECT_FILE" | |
"$HOME/app-builders/${PROGRAM}.sh" -load "$PROJECT_FILE" -build-modern-pwa-data-files -no-save -fp pwa-repo="$WORK_DIR" | |
popd > /dev/null | |
npm run convert | |
npm run test | |
done | |
done |