diff --git a/.github/workflows/crossover-ci.yml b/.github/workflows/crossover-ci.yml new file mode 100644 index 00000000..5bd464ea --- /dev/null +++ b/.github/workflows/crossover-ci.yml @@ -0,0 +1,161 @@ +name: crossover-ci + +on: + push: + branches: + - dev + - master + - release + +jobs: + crossover-ci-mac: + runs-on: macos-latest + steps: + # Make sure build is clean and no files from a previous run are re-used. + - name: Cleanup files before run + run: | + rm -rf * + if: ${{ always() }} + + - uses: actions/checkout@v3 + + # Check memory and cpu + - name: Verify Runner Resources + run: | + sysctl -n machdep.cpu.brand_string + vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages\s+([^:]+)[^\d]+(\d+)/ and printf("%-16s % 16.2f Mi\n", "$1:", $2 * $size / 1048576);' + + - name: Get Node Version + run: | + echo "nodeversion=$(cat .nvmrc)" >> $GITHUB_OUTPUT + id: get-node-version + + - name: Use Node.js ${{ steps.get-node-version.outputs.nodeversion }} + uses: actions/setup-node@v3 + with: + node-version: ${{ steps.get-node-version.outputs.nodeversion }} + cache: "npm" + + - name: Install Dependencies + run: | + env + echo "node: $(node --version)" + echo "npm: $(npm --version)" + echo "yarn: $(yarn --version)" + npm install --openssl_fips="" + + - name: Lint + run: npm run lint + + - name: Check Dependencies + run: npm run depcheck + + # - name: Unpackaged Test ๐Ÿงช + # run: npm run test + + - name: Build + run: | + npm run build:mac --openssl_fips="" + env: + # Set CI flag to false, or the build fails on all warnings, not just errors as locally. + CI: false + + # - name: Package App + # run: | + # npm run pack + # # Check Binary Sizes + # - name: Build Succeeded + # run: | + # ls -alh dist | grep Monokle && du -sh dist/mac || true + # if: ${{ success() }} + + # # - name: E2E Test for Electron ๐Ÿงช + # # run: npm run test + + - name: Upload Test Results ๐Ÿ—ƒ + if: always() + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/* + + crossover-ci-windows: + runs-on: windows-latest + + steps: + # Make sure build is clean and no files from a previous run are re-used. + - name: Cleanup files before run + run: | + cmd /r dir + if: ${{ always() }} + + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it. + - name: Checkout Project + uses: actions/checkout@v3 + + - name: Get Node Version + run: | + Set-PSDebug -Trace 1 + $filePath = ".nvmrc" + Get-Content $filePath -Raw + $content = Get-Content $filePath -Raw + echo "nodeversion=$content" >> $GITHUB_OUTPUT + id: get-node-version + + - name: Use Node.js ${{ steps.get-node-version.outputs.nodeversion }} + uses: actions/setup-node@v3 + with: + node-version: ${{ steps.get-node-version.outputs.nodeversion }} + cache: "npm" + + # - name: Get MSFT Cert + # id: write_file + # uses: timheuer/base64-to-file@v1 + # with: + # fileName: "kubeshop_msft.p12" + # encodedString: ${{ secrets.CERT_MSFT_KUBESHOP_P12_B64 }} + + # Install Dependencies + - name: Install Dependencies + run: | + Set-PSDebug -Trace 1 + node --version + npm --version + yarn --version + npm install + + # - name: Unpackaged Test ๐Ÿงช + # run: npm run test + + - name: Build + run: | + npm run build:windows + env: + # Set CI flag to false, or the build fails on all warnings, not just errors as locally. + # We use circle as ci + CI: false + + # - name: Package + # run: | + # npm exec -c 'electron-builder --publish "never"' + # env: + # GITHUB_TOKEN: ${{ secrets.github_token }} + # WIN_CSC_LINK: ${{ steps.write_file.outputs.filePath }} + # WIN_CSC_KEY_PASSWORD: ${{ secrets.CERT_MSFT_KUBESHOP_P12_PASSWORD }} + # EP_PRE_RELEASE: true + # USE_HARD_LINKS: false + + # # Check Binary Sizes + # - name: Build Succeeded + # run: | + # cmd /r dir .\dist + # if: ${{ success() }} + # - name: E2E Test for Electron ๐Ÿงช + # run: npm run ui-test + + # - name: Upload Test Results ๐Ÿ—ƒ + # if: always() + # uses: actions/upload-artifact@v3 + # with: + # name: playwright-output + # path: test-output/**