Skip to content

Commit

Permalink
Setup a nightly build job (#1251)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
award999 authored Dec 10, 2024
1 parent e29e4d6 commit cf37af5
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 8 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Nightly

on:
schedule:
- cron: "0 0 * * *"

jobs:
tests_release:
name: Test Release
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
# Linux
linux_env_vars: |
NODE_VERSION=v18.19.0
NODE_PATH=/usr/local/nvm/versions/node/v18.19.0/bin
NVM_DIR=/usr/local/nvm
CI=1
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
linux_build_command: ./docker/test.sh
# Windows
windows_env_vars: |
CI=1
VSCODE_TEST=1
windows_pre_build_command: .github\workflows\scripts\windows\install-nodejs.ps1
windows_build_command: docker\test-windows.ps1
enable_windows_docker: false

tests_insiders:
name: Test Insiders
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
# Linux
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"}]'
linux_env_vars: |
NODE_VERSION=v18.19.0
NODE_PATH=/usr/local/nvm/versions/node/v18.19.0/bin
NVM_DIR=/usr/local/nvm
CI=1
VSCODE_TEST=1
VSCODE_VERSION=insiders
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
linux_build_command: ./docker/test.sh
# Windows
windows_exclude_swift_versions: '[{"swift_version": "5.9"}, {"swift_version": "nightly-6.0"}, {"swift_version": "nightly"}]'
windows_env_vars: |
CI=1
VSCODE_TEST=1
VSCODE_VERSION=insiders
windows_pre_build_command: .github\workflows\scripts\windows\install-nodejs.ps1
windows_build_command: docker\test-windows.ps1
enable_windows_docker: false
12 changes: 4 additions & 8 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,18 @@ jobs:
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
# Linux
linux_exclude_swift_versions: '[{"swift_version": "nightly-main"}]'
linux_exclude_swift_versions: '[{"swift_version": "nightly-6.0"},{"swift_version": "nightly-main"}]'
linux_env_vars: |
NODE_VERSION=v18.19.0
NODE_PATH=/usr/local/nvm/versions/node/v18.19.0/bin
NVM_DIR=/usr/local/nvm
CI=1
VSCODE_TEST=1
FAST_TEST_RUN=1
linux_pre_build_command: |
apt-get update && apt-get install -y rsync curl gpg libasound2 libgbm1 libgtk-3-0 libnss3 xvfb build-essential
mkdir -p $NVM_DIR
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
/bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
echo "$NODE_PATH" >> $GITHUB_PATH
linux_pre_build_command: . .github/workflows/scripts/setup-linux.sh
linux_build_command: ./docker/test.sh
# Windows
windows_exclude_swift_versions: '[{"swift_version": "nightly"}]'
windows_exclude_swift_versions: '[{"swift_version": "nightly-6.0"},{"swift_version": "nightly"}]'
windows_env_vars: |
CI=1
VSCODE_TEST=1
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/scripts/setup-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
##===----------------------------------------------------------------------===##
##
## This source file is part of the VS Code Swift open source project
##
## Copyright (c) 2024 the VS Code Swift project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license information
## See CONTRIBUTORS.txt for the list of VS Code Swift project authors
##
## SPDX-License-Identifier: Apache-2.0
##
##===----------------------------------------------------------------------===##

export NODE_VERSION=v18.19.0
export NODE_PATH=/usr/local/nvm/versions/node/v18.19.0/bin
export NVM_DIR=/usr/local/nvm

apt-get update && apt-get install -y rsync curl gpg libasound2 libgbm1 libgtk-3-0 libnss3 xvfb build-essential
mkdir -p $NVM_DIR
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
/bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"
echo "$NODE_PATH" >> "$GITHUB_PATH"

0 comments on commit cf37af5

Please sign in to comment.