Gitpod Code Rebase #787
This file contains 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: Gitpod Code Rebase | |
on: | |
workflow_dispatch: | |
inputs: | |
parent_commit: | |
description: "Parent commit" | |
required: true | |
default: "upstream/main" | |
update_branch: | |
description: "The branch to update" | |
required: true | |
default: "gp-code/main" | |
schedule: | |
- cron: "0 23 * * 1-5" | |
env: | |
# Default values will be used by cron job | |
PARENT_COMMIT: ${{ github.event.inputs.parent_commit || 'upstream/release/1.93' }} | |
UPDATE_BRANCH: ${{ github.event.inputs.update_branch || 'gp-code/release/1.93' }} | |
jobs: | |
sync-gp-code: | |
name: Syncing gp-code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: "gitpod-io/openvscode-server" | |
ref: ${{ env.UPDATE_BRANCH }} | |
fetch-depth: 0 | |
token: ${{ secrets.VSCODE_GITHUB_TOKEN }} | |
- name: Configure git credentials | |
run: | | |
git config user.name Jean Pierre | |
git config user.email jeanpierre@gitpod.io | |
- name: Setup Build Environment | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 libkrb5-dev | |
sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb | |
sudo chmod +x /etc/init.d/xvfb | |
sudo update-rc.d xvfb defaults | |
sudo service xvfb start | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: prepare | |
run: | | |
npm install -g node-gyp | |
- name: Sync with upstream (rebase) | |
run: | | |
./scripts/sync-with-upstream.sh ${{ env.PARENT_COMMIT }} ${{ env.UPDATE_BRANCH }} "gitpod server initial commit" | |
- name: Compute node modules cache key | |
id: nodeModulesCacheKey | |
run: echo "value=$(node build/azure-pipelines/common/computeNodeModulesCacheKey.js)" >> $GITHUB_OUTPUT | |
- name: Cache node modules | |
id: cacheNodeModules | |
uses: actions/cache@v3 | |
with: | |
path: "**/node_modules" | |
key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }} | |
- name: Get yarn cache directory path | |
id: yarnCacheDirPath | |
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Cache yarn directory | |
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.yarnCacheDirPath.outputs.dir }} | |
key: ${{ runner.os }}-yarnCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }} | |
restore-keys: ${{ runner.os }}-yarnCacheDir- | |
- name: Execute yarn | |
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} | |
env: | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
ELECTRON_SKIP_BINARY_DOWNLOAD: 1 | |
run: yarn --frozen-lockfile --network-timeout 180000 | |
- name: Compile | |
run: | | |
yarn npm-run-all --max_old_space_size=4095 -lp compile playwright-install download-builtin-extensions | |
env: | |
DISABLE_V8_COMPILE_CACHE: 1 | |
- name: Push changes | |
run: | | |
git push origin ${{ env.UPDATE_BRANCH }} --force-with-lease | |
- name: Write upstream parent commit to file | |
if: ${{ success() }} | |
run: | | |
echo "$(git rev-parse ${{ env.PARENT_COMMIT }})" > __upstream_commit.txt | |
- name: Upload parent commit file | |
if: ${{ success() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: upstream_commit | |
path: __upstream_commit.txt | |
- name: Get previous job's status | |
id: lastrun | |
uses: filiptronicek/get-last-job-status@main | |
- name: Slack Notification | |
if: ${{ (success() && steps.lastrun.outputs.status == 'failed') || failure() }} | |
uses: rtCamp/action-slack-notify@v2 | |
env: | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_COLOR: ${{ job.status }} | |
SLACK_MESSAGE: | | |
Exec command: | |
``` | |
./scripts/sync-with-upstream.sh ${{ env.PARENT_COMMIT }} ${{ env.UPDATE_BRANCH }} "gitpod server initial commit" | |
``` |