-
Notifications
You must be signed in to change notification settings - Fork 70
115 lines (103 loc) · 3.99 KB
/
insiders-gp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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"
```