From cf37af5f48f778d4a5758cccd934eb012a018813 Mon Sep 17 00:00:00 2001 From: award999 Date: Tue, 10 Dec 2024 14:07:59 -0500 Subject: [PATCH] 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 --- .github/workflows/nightly.yml | 51 ++++++++++++++++++++++++ .github/workflows/pull_request.yml | 12 ++---- .github/workflows/scripts/setup-linux.sh | 24 +++++++++++ 3 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/nightly.yml create mode 100755 .github/workflows/scripts/setup-linux.sh diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 000000000..7ffaad08a --- /dev/null +++ b/.github/workflows/nightly.yml @@ -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 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 796ab2521..2dd885f25 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -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 diff --git a/.github/workflows/scripts/setup-linux.sh b/.github/workflows/scripts/setup-linux.sh new file mode 100755 index 000000000..82e70d523 --- /dev/null +++ b/.github/workflows/scripts/setup-linux.sh @@ -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" \ No newline at end of file