Skip to content

Gitpod Code Rebase #850

Gitpod Code Rebase

Gitpod Code Rebase #850

Workflow file for this run

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/main' }}
UPDATE_BRANCH: ${{ github.event.inputs.update_branch || 'gp-code/main' }}
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 [email protected]
- 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@v4
with:
node-version-file: .nvmrc
- 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@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-cacheNodeModulesLinux-${{ steps.nodeModulesCacheKey.outputs.value }}
- name: Get npm cache directory path
id: npmCacheDirPath
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
- name: Cache npm directory
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
uses: actions/cache@v4
with:
path: ${{ steps.npmCacheDirPath.outputs.dir }}
key: ${{ runner.os }}-npmCacheDir-${{ steps.nodeModulesCacheKey.outputs.value }}
restore-keys: ${{ runner.os }}-npmCacheDir-
- name: Execute npm
if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }}
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
run: npm ci
- name: Compile
run: |
npm exec -- npm-run-all -lp compile playwright-install download-builtin-extensions
- 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@v4
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"
```