Merge pull request #70 from PytorchConnectomics/react-dev-server #99
This file contains hidden or 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: Client App Build and Test | |
| 'on': | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'client/**' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'client/**' | |
| jobs: | |
| build-and-test-client: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out the repo | |
| uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: Install Dependencies | |
| run: | | |
| cd client | |
| npm install -g npm@latest | |
| npm install | |
| - name: Install and start Xvfb | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y xvfb | |
| export DISPLAY=':99.0' | |
| Xvfb :99 -screen 0 1280x720x24 > /dev/null 2>&1 & | |
| - name: Build Client App | |
| env: | |
| ELECTRON_ENABLE_LOGGING: true | |
| DISPLAY: ':99.0' | |
| run: | | |
| cd client | |
| npm run build | |
| npm run electron & | |
| ELECTRON_PID=$! | |
| sleep 150 | |
| if ps -p "$ELECTRON_PID" > /dev/null; then | |
| echo 'Electron app is still running, Ending the process.' | |
| kill "$ELECTRON_PID" | |
| else | |
| echo 'Electron app has exited.' | |
| exit 1 | |
| fi |