Skip to content

Commit cf37af5

Browse files
authored
Setup a nightly build job (#1251)
* Setup a nightly build job * Renaming workflow file to "test.yml" so we can share the setup, using the event_name to decide if full test matrix should be run or not * Run insiders nightly Issue: #934 * Eval for linux command * Add linux setup to script * Move node/nvm env vars to setup script * Split jobs into separate files Not easy to share across extended workflows and would show a bunch of skipped jobs in the PR so will have as separate files, sharing scripts * Fix soundness checks * Only run current release against insiders * Verify nightly build if PR changes that file * Don't run nightly-6.0 in CI With a nightly job in place, we don't want unreleased changes to break our CI * Fix review comment
1 parent e29e4d6 commit cf37af5

File tree

3 files changed

+79
-8
lines changed

3 files changed

+79
-8
lines changed

.github/workflows/nightly.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Nightly
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
tests_release:
9+
name: Test Release
10+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
11+
with:
12+
# Linux
13+
linux_env_vars: |
14+
NODE_VERSION=v18.19.0
15+
NODE_PATH=/usr/local/nvm/versions/node/v18.19.0/bin
16+
NVM_DIR=/usr/local/nvm
17+
CI=1
18+
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
19+
linux_build_command: ./docker/test.sh
20+
# Windows
21+
windows_env_vars: |
22+
CI=1
23+
VSCODE_TEST=1
24+
windows_pre_build_command: .github\workflows\scripts\windows\install-nodejs.ps1
25+
windows_build_command: docker\test-windows.ps1
26+
enable_windows_docker: false
27+
28+
tests_insiders:
29+
name: Test Insiders
30+
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
31+
with:
32+
# Linux
33+
linux_exclude_swift_versions: '[{"swift_version": "5.8"}, {"swift_version": "5.9"}, {"swift_version": "5.10"}, {"swift_version": "nightly-6.0"}, {"swift_version": "nightly-main"}]'
34+
linux_env_vars: |
35+
NODE_VERSION=v18.19.0
36+
NODE_PATH=/usr/local/nvm/versions/node/v18.19.0/bin
37+
NVM_DIR=/usr/local/nvm
38+
CI=1
39+
VSCODE_TEST=1
40+
VSCODE_VERSION=insiders
41+
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
42+
linux_build_command: ./docker/test.sh
43+
# Windows
44+
windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "nightly-6.0"}, {"swift_version": "nightly"}]'
45+
windows_env_vars: |
46+
CI=1
47+
VSCODE_TEST=1
48+
VSCODE_VERSION=insiders
49+
windows_pre_build_command: .github\workflows\scripts\windows\install-nodejs.ps1
50+
windows_build_command: docker\test-windows.ps1
51+
enable_windows_docker: false

.github/workflows/pull_request.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,18 @@ jobs:
1010
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
1111
with:
1212
# Linux
13-
linux_exclude_swift_versions: '[{"swift_version": "nightly-main"}]'
13+
linux_exclude_swift_versions: '[{"swift_version": "nightly-6.0"},{"swift_version": "nightly-main"}]'
1414
linux_env_vars: |
1515
NODE_VERSION=v18.19.0
1616
NODE_PATH=/usr/local/nvm/versions/node/v18.19.0/bin
1717
NVM_DIR=/usr/local/nvm
1818
CI=1
19+
VSCODE_TEST=1
1920
FAST_TEST_RUN=1
20-
linux_pre_build_command: |
21-
apt-get update && apt-get install -y rsync curl gpg libasound2 libgbm1 libgtk-3-0 libnss3 xvfb build-essential
22-
mkdir -p $NVM_DIR
23-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
24-
/bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
25-
echo "$NODE_PATH" >> $GITHUB_PATH
21+
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
2622
linux_build_command: ./docker/test.sh
2723
# Windows
28-
windows_exclude_swift_versions: '[{"swift_version": "nightly"}]'
24+
windows_exclude_swift_versions: '[{"swift_version": "nightly-6.0"},{"swift_version": "nightly"}]'
2925
windows_env_vars: |
3026
CI=1
3127
VSCODE_TEST=1
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
##===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the VS Code Swift open source project
5+
##
6+
## Copyright (c) 2024 the VS Code Swift project authors
7+
## Licensed under Apache License v2.0
8+
##
9+
## See LICENSE.txt for license information
10+
## See CONTRIBUTORS.txt for the list of VS Code Swift project authors
11+
##
12+
## SPDX-License-Identifier: Apache-2.0
13+
##
14+
##===----------------------------------------------------------------------===##
15+
16+
export NODE_VERSION=v18.19.0
17+
export NODE_PATH=/usr/local/nvm/versions/node/v18.19.0/bin
18+
export NVM_DIR=/usr/local/nvm
19+
20+
apt-get update && apt-get install -y rsync curl gpg libasound2 libgbm1 libgtk-3-0 libnss3 xvfb build-essential
21+
mkdir -p $NVM_DIR
22+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
23+
/bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
24+
echo "$NODE_PATH" >> "$GITHUB_PATH"

0 commit comments

Comments
 (0)