diff options
author | Eric Erhardt <eric.erhardt@microsoft.com> | 2021-09-29 19:41:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-29 19:41:36 +0300 |
commit | 8e4c996ae35aa803813a89faebb03eb01821c1a2 (patch) | |
tree | f083bbb1ee9390fc50f8cce9712265b5f07dbe8b | |
parent | 37ceb3c260a7f9030a64890ba67389cd1c5794de (diff) |
Add initial codespaces support for dotnet/runtime (#59723)
* Add initial codespaces support for dotnet/runtime
* Enable codespaces-prebuild
-rw-r--r-- | .devcontainer/Dockerfile | 12 | ||||
-rw-r--r-- | .devcontainer/devcontainer.json | 35 | ||||
-rw-r--r-- | .devcontainer/scripts/onCreateCommand.sh | 6 | ||||
-rw-r--r-- | .github/workflows/create-codespaces-prebuild.yml | 17 | ||||
-rw-r--r-- | .gitignore | 1 |
5 files changed, 70 insertions, 1 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000000..31ff731b029 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,12 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet/.devcontainer/base.Dockerfile + +# [Choice] .NET version: 5.0, 3.1, 2.1 +ARG VARIANT="5.0" +FROM mcr.microsoft.com/vscode/devcontainers/dotnet:0-${VARIANT} + +# Set up machine requirements to build the repo +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends cmake llvm-9 clang-9 \ + build-essential python curl git lldb-6.0 liblldb-6.0-dev \ + libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev \ + libssl-dev libnuma-dev libkrb5-dev zlib1g-dev ninja-build diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..b3dfd99aebd --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/dotnet +{ + "name": "C# (.NET)", + "build": { + "dockerfile": "Dockerfile", + "args": { + // Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0 + "VARIANT": "5.0", + } + }, + + "settings": { + // Loading projects on demand is better for larger codebases + "omnisharp.enableMsBuildLoadProjectsOnDemand": true + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "ms-dotnettools.csharp" + ], + + // Use 'onCreateCommand' to run pre-build commands inside the codespace + "onCreateCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/onCreateCommand.sh", + + // Add the locally installed dotnet to the path to ensure that it is activated + // This allows developers to just use 'dotnet build' on the command-line, and the local dotnet version will be used. + "remoteEnv": { + "PATH": "${containerWorkspaceFolder}/.dotnet:${containerEnv:PATH}", + "DOTNET_MULTILEVEL_LOOKUP": "0" + }, + + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "vscode" +} diff --git a/.devcontainer/scripts/onCreateCommand.sh b/.devcontainer/scripts/onCreateCommand.sh new file mode 100644 index 00000000000..dc0154c619b --- /dev/null +++ b/.devcontainer/scripts/onCreateCommand.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -e + +# prebuild the repo, so it is ready for development +./build.sh libs+clr -rc Release diff --git a/.github/workflows/create-codespaces-prebuild.yml b/.github/workflows/create-codespaces-prebuild.yml new file mode 100644 index 00000000000..6b55740121c --- /dev/null +++ b/.github/workflows/create-codespaces-prebuild.yml @@ -0,0 +1,17 @@ +name: Create Codespaces Prebuild +on: + schedule: + # Run at 06:00 am UTC every day + - cron: '0 6 * * *' + workflow_dispatch: +jobs: + createPrebuild: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: github/codespaces-precache@v1.0.1 + with: + regions: WestUs2 + sku_name: standardLinux32gb + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 59881767990..dbdbce21b05 100644 --- a/.gitignore +++ b/.gitignore @@ -279,7 +279,6 @@ Session.vim # Visual Studio Code .vscode/ -.devcontainer/ # Private test configuration and binaries. config.ps1 |