From d1a096804d7af8af866f95ae5f5cd41e37876770 Mon Sep 17 00:00:00 2001 From: Okiki Date: Tue, 15 Oct 2024 05:03:01 +0000 Subject: [PATCH] ci: setup ci Signed-off-by: Okiki --- .devcontainer/devcontainer.json | 25 +++++++++++++++++++++++++ .github/dependabot.yml | 12 ++++++++++++ .github/workflow/main.yml | 19 +++++++++++++++++++ .gitpod.Dockerfile | 17 +++++++++++++++++ .gitpod.yml | 24 ++++++++++++++++++++++++ 5 files changed, 97 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .github/dependabot.yml create mode 100644 .github/workflow/main.yml create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..346c8c1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,25 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm", + "features": { + "ghcr.io/devcontainers-community/features/deno:1": {} + } + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // 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": "yarn install", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f33a02c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for more information: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +# https://containers.dev/guide/dependabot + +version: 2 +updates: + - package-ecosystem: "devcontainers" + directory: "/" + schedule: + interval: weekly diff --git a/.github/workflow/main.yml b/.github/workflow/main.yml new file mode 100644 index 0000000..a0ee251 --- /dev/null +++ b/.github/workflow/main.yml @@ -0,0 +1,19 @@ +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: denoland/setup-deno@v1 + with: + deno-version: 2.x + - uses: oven-sh/setup-bun@v1 + with: + bun-version: 1.x + - uses: actions/setup-node@v4 + with: + node-version: 22.x + - run: deno task ci \ No newline at end of file diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..6909ce1 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,17 @@ +FROM gitpod/workspace-full:latest + +# Install custom tools, runtime, etc. using apt-get +# For example, the command below would install "bastet" - a command line tetris clone: +# +# RUN sudo apt-get -q update && # sudo apt-get install -yq bastet && # sudo rm -rf /var/lib/apt/lists/* +# +# More information: https://www.gitpod.io/docs/config-docker/ + +RUN curl -fsSL https://deno.land/x/install/install.sh | sh +RUN /home/gitpod/.deno/bin/deno completions bash > /home/gitpod/.bashrc.d/90-deno && \ + echo 'export DENO_INSTALL="/home/gitpod/.deno"' >> /home/gitpod/.bashrc.d/90-deno && \ + echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> /home/gitpod/.bashrc.d/90-deno + +RUN curl -fsSL https://bun.sh/install | bash +RUN echo 'export BUN_INSTALL="/home/gitpod/.bun"' >> /home/gitpod/.bashrc.d/600-bun | bash && \ + echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> /home/gitpod/.bashrc.d/600-bun | bash \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..6b60a80 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,24 @@ +image: + file: .gitpod.Dockerfile + +# List the ports you want to expose and what to do when they are served. See https://www.gitpod.io/docs/43_config_ports/ +ports: + - port: 4321 + onOpen: notify + - port: 3000 + onOpen: notify + +# List the start up tasks. You can start them in parallel in multiple terminals. See https://www.gitpod.io/docs/44_config_start_tasks/ +tasks: + - init: > + nvm install && + npm install -g pnpm && + pnpm install + command: > + nvm install && + npm install -g pnpm && + pnpm install + +vscode: + extensions: + - denoland.vscode-deno -- 2.51.2