Skip to content

Commit

Permalink
chore: add GitHub codespaces config [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Aug 13, 2021
1 parent 9cea796 commit 544a761
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .buildkite/publish/buildkite-entry.sh
Expand Up @@ -14,7 +14,7 @@ cd ..
# Any update here needs to be done for
# - https://github.com/prisma/prisma/blob/main/.github/workflows/test.yml#L8 GitHub Actions
# - https://github.com/prisma/prisma/blob/main/.buildkite/test/buildkite-entry.sh
EXCLUDE_LIST="*.bench.ts,docs,.vscode,examples,graphs,README.md,LICENSE,CONTRIBUTING.md,.github"
EXCLUDE_LIST="*.bench.ts,docs,.devcontainer,.vscode,examples,graphs,README.md,LICENSE,CONTRIBUTING.md,.github"
echo $EXCLUDE_LIST
node last-git-changes/bin.js --exclude="$EXCLUDE_LIST"
export CHANGED_COUNT=$(node last-git-changes/bin.js --exclude="$EXCLUDE_LIST" | wc -l)
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/test/buildkite-entry.sh
Expand Up @@ -14,7 +14,7 @@ cd ..
# Any update here needs to be done for
# - https://github.com/prisma/prisma/blob/main/.github/workflows/test.yml#L8 GitHub Actions
# - https://github.com/prisma/prisma/blob/main/.buildkite/publish/buildkite-entry.sh
EXCLUDE_LIST="*.bench.ts,docs,.vscode,examples,scripts/ci/publish.ts,graphs,README.md,LICENSE,CONTRIBUTING.md,.github"
EXCLUDE_LIST="*.bench.ts,docs,.devcontainer,.vscode,examples,scripts/ci/publish.ts,graphs,README.md,LICENSE,CONTRIBUTING.md,.github"
echo $EXCLUDE_LIST
node last-git-changes/bin.js --exclude="$EXCLUDE_LIST"
export CHANGED_COUNT=$(node last-git-changes/bin.js --exclude="$EXCLUDE_LIST" | wc -l)
Expand Down
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
@@ -0,0 +1,16 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/typescript-node/.devcontainer/base.Dockerfile

# [Choice] Node.js version: 16, 14, 12
ARG VARIANT="14-buster"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# [Optional] Uncomment if you want to install more global node packages
# RUN su node -c "npm install -g <your-package-list -here>"
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
@@ -0,0 +1,43 @@
// 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.187.0/containers/typescript-node
{
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 12, 14, 16
"args": {
"VARIANT": "14"
}
},

// Set *default* container specific settings.json values on container create.
"settings": {
"telemetry.enableTelemetry": false,
"redhat.telemetry.enabled": false,
"vulnCost.sendStatistics": false,

"editor.renderWhitespace": "all",
"editor.renderControlCharacters": true,
"editor.formatOnSave": true,

"files.insertFinalNewline": true,
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
// "dbaeumer.vscode-eslint",
"Prisma.prisma-insider",
"esbenp.prettier-vscode",
"Orta.vscode-jest",
"GitHub.vscode-pull-request-github"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install -g pnpm && pnpm install && pnpm run setup",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}
1 change: 1 addition & 0 deletions .github/workflows/benchmark.yml
Expand Up @@ -10,6 +10,7 @@ on:
# - https://github.com/prisma/prisma/blob/main/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/main/.buildkite/publish/buildkite-entry.sh
- "*.md"
- ".devcontainer/**"
- ".vscode/**"
- "docs/**"
- "examples/**"
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/test.yml
Expand Up @@ -11,6 +11,7 @@ on:
# - https://github.com/prisma/prisma/blob/main/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/main/.buildkite/publish/buildkite-entry.sh
- '*.md'
- '.devcontainer/**'
- '.vscode/**'
- '.github/ISSUE_TEMPLATE/**'
- 'docs/**'
Expand All @@ -29,6 +30,7 @@ on:
# - https://github.com/prisma/prisma/blob/main/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/main/.buildkite/publish/buildkite-entry.sh
- '*.md'
- '.devcontainer/**'
- '.vscode/**'
- '.github/ISSUE_TEMPLATE/**'
- 'docs/**'
Expand All @@ -52,7 +54,7 @@ jobs:
jobs: ${{ steps.detect.outputs.jobs }}
steps:
- id: checkout
uses: actions/checkout@v2
uses: actions/checkout@v2
- id: files
uses: Ana06/get-changed-files@v1.2 # it's a fork of jitterbit/get-changed-files@v1 which works better with pull requests
with:
Expand All @@ -79,7 +81,7 @@ jobs:
runs-on: ubuntu-20.04
# Ignore if renovate (dependency update)
if: "!contains(github.actor, 'renovate')"

steps:
- uses: actions/checkout@v2

Expand All @@ -102,7 +104,6 @@ jobs:
- run: pnpm run lint
working-directory: ./


#
# CLIENT (without types test)
#
Expand All @@ -128,7 +129,7 @@ jobs:
echo "PRISMA_CLIENT_ENGINE_TYPE={{ matrix.engine }}" >> $GITHUB_ENV
- run: docker-compose -f docker/docker-compose.yml up --detach postgres postgres_isolated mysql mysql_isolated mssql

- name: Cache .pnpm-store # From https://pnpm.io/continuous-integration
uses: actions/cache@v1
with:
Expand Down Expand Up @@ -242,7 +243,7 @@ jobs:
- run: docker-compose -f docker/docker-compose.yml up --detach ${{matrix.database}}
if: matrix.database != 'sqlite'

- name: Cache .pnpm-store # From https://pnpm.io/continuous-integration
uses: actions/cache@v1
with:
Expand Down Expand Up @@ -306,11 +307,11 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set CLI Engine Type
run: |
echo "PRISMA_CLI_QUERY_ENGINE_TYPE={{ matrix.cliQueryEngine }}" >> $GITHUB_ENV
- name: Cache .pnpm-store # From https://pnpm.io/continuous-integration
uses: actions/cache@v1
with:
Expand Down Expand Up @@ -361,7 +362,7 @@ jobs:
- uses: actions/checkout@v2

- run: docker-compose -f docker/docker-compose.yml up --detach postgres mysql mssql

- name: Set CLI Engine Type
run: |
echo "PRISMA_CLI_QUERY_ENGINE_TYPE={{ matrix.cliQueryEngine }}" >> $GITHUB_ENV
Expand Down Expand Up @@ -398,8 +399,8 @@ jobs:
TEST_MYSQL_URI_MIGRATE: mysql://root:root@localhost:3306/tests-migrate
TEST_MYSQL_SHADOWDB_URI_MIGRATE: mysql://root:root@localhost:3306/tests-migrate-shadowdb
TEST_MSSQL_URI: mssql://SA:Pr1sm4_Pr1sm4@localhost:1433/master
TEST_MSSQL_JDBC_URI_MIGRATE: "sqlserver://localhost:1433;database=tests-migrate;user=SA;password=Pr1sm4_Pr1sm4;trustServerCertificate=true;encrypt=DANGER_PLAINTEXT"
TEST_MSSQL_SHADOWDB_JDBC_URI_MIGRATE: "sqlserver://localhost:1433;database=tests-migrate-shadowdb;user=SA;password=Pr1sm4_Pr1sm4;trustServerCertificate=true;encrypt=DANGER_PLAINTEXT"
TEST_MSSQL_JDBC_URI_MIGRATE: 'sqlserver://localhost:1433;database=tests-migrate;user=SA;password=Pr1sm4_Pr1sm4;trustServerCertificate=true;encrypt=DANGER_PLAINTEXT'
TEST_MSSQL_SHADOWDB_JDBC_URI_MIGRATE: 'sqlserver://localhost:1433;database=tests-migrate-shadowdb;user=SA;password=Pr1sm4_Pr1sm4;trustServerCertificate=true;encrypt=DANGER_PLAINTEXT'

- uses: codecov/codecov-action@v2
with:
Expand All @@ -426,7 +427,7 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Set CLI Engine Type
run: |
echo "PRISMA_CLI_QUERY_ENGINE_TYPE={{ matrix.cliQueryEngine }}" >> $GITHUB_ENV
Expand Down

0 comments on commit 544a761

Please sign in to comment.