|
| 1 | +name: Test Documentation Scripts - Frontend |
| 2 | + |
| 3 | +# Test locally with: |
| 4 | +# ```bash |
| 5 | +# # Ubuntu 22.04 (recommended) |
| 6 | +# gh extension exec act \ |
| 7 | +# --workflows .github/workflows/test-docs-scripts-frontend.yaml \ |
| 8 | +# --matrix os:ubuntu-22.04 |
| 9 | +# |
| 10 | +# # Ubuntu 24.04 (requires platform mapping) |
| 11 | +# gh extension exec act \ |
| 12 | +# --workflows .github/workflows/test-docs-scripts-frontend.yaml \ |
| 13 | +# --matrix os:ubuntu-24.04 \ |
| 14 | +# -P ubuntu-24.04=catthehacker/ubuntu:act-24.04 |
| 15 | +# ``` |
| 16 | + |
| 17 | +on: |
| 18 | + push: |
| 19 | + |
| 20 | +jobs: |
| 21 | + test-frontend-scripts: |
| 22 | + runs-on: ${{ matrix.os }} |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + os: [ubuntu-22.04, ubuntu-24.04, macos-latest] |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Checkout repository |
| 29 | + uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - name: Make scripts executable |
| 32 | + run: | |
| 33 | + chmod +x website/docs/developers/scripts/frontend/*.sh |
| 34 | +
|
| 35 | + - name: Install Node.js on Linux |
| 36 | + if: runner.os == 'Linux' |
| 37 | + run: | |
| 38 | + bash website/docs/developers/scripts/frontend/install-nodejs-linux.sh |
| 39 | + # Set up nvm environment for future steps |
| 40 | + echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV |
| 41 | +
|
| 42 | + - name: Install Node.js on macOS |
| 43 | + if: runner.os == 'macOS' |
| 44 | + run: | |
| 45 | + bash website/docs/developers/scripts/frontend/install-nodejs-macos.sh |
| 46 | +
|
| 47 | + - name: Install Angular CLI using documentation script |
| 48 | + run: | |
| 49 | + # Source nvm if available (Linux) |
| 50 | + if [ -n "$NVM_DIR" ] && [ -s "$NVM_DIR/nvm.sh" ]; then |
| 51 | + \. "$NVM_DIR/nvm.sh" |
| 52 | + fi |
| 53 | + bash website/docs/developers/scripts/frontend/install-angular-cli.sh |
| 54 | +
|
| 55 | + - name: Install gtimeout on macOS |
| 56 | + if: runner.os == 'macOS' |
| 57 | + run: | |
| 58 | + brew install coreutils |
| 59 | + # Create symlink for timeout command |
| 60 | + sudo ln -sf /usr/local/bin/gtimeout /usr/local/bin/timeout |
| 61 | +
|
| 62 | + - name: Test install dependencies script |
| 63 | + run: | |
| 64 | + # Source nvm if available (Linux) |
| 65 | + if [ -n "$NVM_DIR" ] && [ -s "$NVM_DIR/nvm.sh" ]; then |
| 66 | + \. "$NVM_DIR/nvm.sh" |
| 67 | + fi |
| 68 | + bash website/docs/developers/scripts/frontend/install-dependencies.sh |
| 69 | +
|
| 70 | + - name: Test build development script |
| 71 | + run: | |
| 72 | + # Source nvm if available (Linux) |
| 73 | + if [ -n "$NVM_DIR" ] && [ -s "$NVM_DIR/nvm.sh" ]; then |
| 74 | + \. "$NVM_DIR/nvm.sh" |
| 75 | + fi |
| 76 | + bash website/docs/developers/scripts/frontend/build-development.sh |
| 77 | +
|
| 78 | + - name: Test build production script |
| 79 | + run: | |
| 80 | + # Source nvm if available (Linux) |
| 81 | + if [ -n "$NVM_DIR" ] && [ -s "$NVM_DIR/nvm.sh" ]; then |
| 82 | + \. "$NVM_DIR/nvm.sh" |
| 83 | + fi |
| 84 | + bash website/docs/developers/scripts/frontend/build-production.sh |
| 85 | +
|
| 86 | + - name: Test format code script |
| 87 | + run: | |
| 88 | + # Source nvm if available (Linux) |
| 89 | + if [ -n "$NVM_DIR" ] && [ -s "$NVM_DIR/nvm.sh" ]; then |
| 90 | + \. "$NVM_DIR/nvm.sh" |
| 91 | + fi |
| 92 | + bash website/docs/developers/scripts/frontend/format-code.sh |
| 93 | +
|
| 94 | + - name: Prepare for Cypress tests (Ubuntu 22.04) |
| 95 | + if: matrix.os == 'ubuntu-22.04' |
| 96 | + run: | |
| 97 | + sudo apt-get update |
| 98 | + sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev \ |
| 99 | + libnss3 libxss1 libasound2 libxtst6 xauth xvfb |
| 100 | +
|
| 101 | + - name: Prepare for Cypress tests (Ubuntu 24.04) |
| 102 | + if: matrix.os == 'ubuntu-24.04' |
| 103 | + run: | |
| 104 | + sudo apt-get update |
| 105 | + sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev \ |
| 106 | + libnss3 libxss1 libasound2t64 libxtst6 xauth xvfb |
0 commit comments