diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9e81e28..70232b1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,29 +1,29 @@ { - "name": "Deno", - "build": { - "dockerfile": "Dockerfile" - }, + "name": "Deno", + "build": { + "dockerfile": "Dockerfile" + }, - // Configure tool-specific properties. - "customizations": { - // Configure properties specific to VS Code. - "vscode": { - // Set *default* container specific settings.json values on container create. - "settings": { - // Enables the project as a Deno project - "deno.enable": true, - // Enables Deno linting for the project - "deno.lint": true, - // Sets Deno as the default formatter for the project - "editor.defaultFormatter": "denoland.vscode-deno" - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "denoland.vscode-deno" - ] - } - }, + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + // Enables the project as a Deno project + "deno.enable": true, + // Enables Deno linting for the project + "deno.lint": true, + // Sets Deno as the default formatter for the project + "editor.defaultFormatter": "denoland.vscode-deno" + }, - "remoteUser": "vscode" -} \ No newline at end of file + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "denoland.vscode-deno" + ] + } + }, + + "remoteUser": "vscode" +} diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c40c05c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +cache/ +export/ +*.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..11c467e --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,30 @@ +name: Build +on: [push, pull_request] +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + deno: [1.x, "1.21.x", canary] + steps: + - uses: actions/checkout@v2 + - uses: denoland/setup-deno@v1 + with: + deno-version: ${{ matrix.deno }} + - name: Check fmt + run: deno fmt --check + - name: Run lint + run: deno lint + - name: All entries + uses: tj-actions/glob@v16 + id: entries + with: + files: | + s3si.ts + initRank.ts + ./scripts/*.ts + - name: Check entries + run: deno check ${{ steps.entries.outputs.paths }} + - name: Run tests + run: deno test diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..661790a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM denoland/deno:1.26.2 + +WORKDIR /app + +# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified). +# Ideally cache deps.ts will download and compile _all_ external files used in main.ts. +COPY deps.ts . +RUN deno cache deps.ts + +# These steps will be re-run upon each file change in your working directory: +ADD . . +# Compile the main app so that it doesn't need to be compiled each startup/entry. +RUN deno cache s3si.ts + +CMD ["run", "-A", "s3si.ts", "-n"] \ No newline at end of file