Build, package and test #1301
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: Build, package and test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: '0 4 * * 0' | |
| jobs: | |
| build: | |
| name: ${{ matrix.os }}, Node.js v${{ matrix.node }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-2022, ubuntu-22.04, macos-13, macos-14] # macOS-13 is for x64, macOS-14 is for arm64 | |
| node: ['20.x'] | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 # To fetch all history for all branches and tags. (Will be required for caching with lerna: https://github.com/markuplint/markuplint/pull/111) | |
| - name: Use Node.js ${{ matrix.node }} | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Use Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Build and package (Windows, Linux) | |
| if: runner.os == 'Windows' || runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| yarn --skip-integrity-check --network-timeout 100000 | |
| yarn build:dev | |
| yarn download:plugins | |
| yarn package:applications:preview | |
| env: | |
| NODE_OPTIONS: --max_old_space_size=4096 | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9 | |
| - name: Update electron-builder.yml for macOS-14 | |
| if: matrix.os == 'macos-14' | |
| run: | | |
| sed -i '' 's|https://download.eclipse.org/theia/cdt-cloud/latest/macos|https://download.eclipse.org/theia/cdt-cloud/latest/macos-arm|g' applications/electron/electron-builder.yml | |
| - name: Build and package (Mac) | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| yarn --skip-integrity-check --network-timeout 100000 | |
| yarn build:extensions | |
| yarn download:plugins | |
| yarn tracecompass-server:download | |
| yarn electron build | |
| yarn electron package | |
| env: | |
| NODE_OPTIONS: --max_old_space_size=4096 | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://github.com/microsoft/vscode-ripgrep/issues/9 | |
| - name: Upload Mac Dist Files | |
| if: runner.os == 'macOS' | |
| uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #4.6.1 | |
| with: | |
| name: ${{ matrix.os == 'macos-13' && 'mac-x64' || matrix.os == 'macos-14' && 'mac-arm64'}} | |
| path: | | |
| applications/electron/dist/** | |
| !applications/electron/dist/mac/** | |
| !applications/electron/dist/mac-arm64/** | |
| retention-days: 1 | |
| - name: Test (Linux) | |
| if: matrix.tests != 'skip' && runner.os == 'Linux' | |
| uses: GabrielBB/xvfb-action@86d97bde4a65fe9b290c0b3fb92c2c4ed0e5302d #1.6 | |
| with: | |
| run: yarn electron test | |
| - name: Test (Windows) | |
| if: matrix.tests != 'skip' && runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| yarn electron test | |
| - name: Test (macOS) | |
| if: matrix.tests != 'skip' && runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| yarn electron test | |
| - name: Lint | |
| if: matrix.tests != 'skip' | |
| shell: bash | |
| run: | | |
| yarn lint |