From ee8282a69c9c234c184b71f3a3cf8f1c2c291edf Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Mon, 6 Nov 2023 15:20:54 +0100 Subject: [PATCH] Build REPL on CI --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++++- packages/dev/repl/write-commit.js | 4 +- 2 files changed, 67 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83fc54eace9e..e040bb392f94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,8 @@ -on: pull_request +on: + pull_request: + push: + branches: + - 'repl-v2-ide' name: Continuous Integration @@ -70,6 +74,15 @@ jobs: - run: yarn --frozen-lockfile - run: yarn build-native-release - run: yarn test:unit + - name: Upload @parcel/rust Linux Binaries artifact + if: ${{matrix.os == 'ubuntu-latest' && matrix.node == 20}} + uses: actions/upload-artifact@v2 + with: + name: Rust Linux Binaries + path: | + packages/core/rust/index.d.ts + packages/core/rust/index.js + packages/core/rust/*.node integration_tests: name: Integration tests (${{matrix.os}}, Node ${{matrix.node}}) @@ -109,6 +122,57 @@ jobs: name: Integration tests (${{matrix.os}}, node ${{matrix.node}}) path: '**/junit-*.xml' + repl_build: + name: Build REPL + runs-on: ubuntu-latest + needs: [unit_tests] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: yarn + node-version: 20 + - uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown + - name: Install wasm-opt + run: | + curl -L -O https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz + tar -xf binaryen-version_116-x86_64-linux.tar.gz + echo "$PWD/binaryen-version_116/bin" >> $GITHUB_PATH + - uses: Swatinem/rust-cache@v1 + with: + key: wasm + - name: Bump max inotify watches + run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p; + - run: yarn --frozen-lockfile + - name: Download @parcel/rust Linux Binaries artifact + uses: actions/download-artifact@v3 + with: + name: Rust Linux Binaries + path: packages/core/rust + - run: yarn build + - run: yarn build-native-wasm + - run: yarn workspace @parcel/repl build + - name: Upload REPL + uses: actions/upload-artifact@v2 + with: + name: REPL + path: 'packages/dev/repl/dist' + - name: Deploy to Vercel + uses: amondnet/vercel-action@v25 + id: vercel-action + with: + vercel-token: ${{ secrets.REPL_VERCEL_TOKEN }} + vercel-org-id: ${{ secrets.REPL_VERCEL_ORG_ID }} + vercel-project-id: ${{ secrets.REPL_VERCEL_PROJECT_ID }} + github-comment: false + working-directory: packages/dev/repl + # vercel-args: '--prod' + # alias-domains: | + # staging.angular.vercel-action.amond.dev + # pr-{{PR_NUMBER}}.angular.vercel-action.amond.dev + test_report: name: Test report runs-on: ubuntu-latest diff --git a/packages/dev/repl/write-commit.js b/packages/dev/repl/write-commit.js index 3daec7e22524..cb5ed4979069 100644 --- a/packages/dev/repl/write-commit.js +++ b/packages/dev/repl/write-commit.js @@ -8,8 +8,8 @@ let file = path.join(__dirname, 'commit'); let oldCommit = fs.existsSync(file) && fs.readFileSync(file, 'utf8').trim(); const newCommit = child_process - .execSync('git merge-base v2 HEAD', {encoding: 'utf8'}) - // .execSync('git rev-parse HEAD', {encoding: 'utf8'}) + // .execSync('git merge-base v2 HEAD', {encoding: 'utf8'}) + .execSync('git rev-parse HEAD', {encoding: 'utf8'}) .trim(); if (oldCommit !== newCommit) {