diff --git a/.github/workflows/merge-check.yml b/.github/workflows/merge-check.yml new file mode 100644 index 000000000..e7dc943f8 --- /dev/null +++ b/.github/workflows/merge-check.yml @@ -0,0 +1,45 @@ +name: Merge Check + +"on": + pull_request: + branches: + - "main" + +# Cancel any in-flight jobs +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: pipenv + + - name: Install Python dependencies + run: | + pip install pipenv + # pipenv install + pipenv sync + + - name: Run DVC pipelines + run: | + pipenv run dvc --version + pipenv run dvc update -R working + pipenv run dvc repro -R scripts + + - name: Setup Deno + uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + + - name: Build site + shell: bash + run: deno task build diff --git a/.gitignore b/.gitignore index c3115aa24..1e77d1455 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,8 @@ design/data/ __pycache__ /MM23_variable_lookup.csv .env + +# Debugging files +*.cpuprofile +*.heapprofile +*.heapsnapshot \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..683ac9f5a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,21 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "request": "launch", + "name": "Debug site", + "type": "node", + // "program": "${workspaceFolder}/main.ts", + "cwd": "${workspaceFolder}", + "runtimeExecutable": "/home/giles/.deno/bin/deno", + "runtimeArgs": [ + "task", + "lume_debug", + ], + "attachSimplePort": 9229 + } + ] +} \ No newline at end of file diff --git a/_config.js b/_config.js index 6d082fbbc..934a584e3 100644 --- a/_config.js +++ b/_config.js @@ -111,7 +111,7 @@ site.use(date({ })); // Add csv loader -site.loadData(['.csv'], csvLoader); +site.loadData(['.csv'], csvLoader()); site.loadData(['.geojson', '.hexjson'], jsonLoader); site.loadData(['.md']); diff --git a/deno.json b/deno.json index d125f977b..bf850ca21 100644 --- a/deno.json +++ b/deno.json @@ -4,7 +4,8 @@ "lume": "echo \"import 'lume/cli.ts'\" | deno run --v8-flags=--max-old-space-size=2048 --unstable -A -", "build": "deno task lume", "serve": "deno task lume -s", - "validate": "deno run --allow-env --allow-read=src/_data/reports --allow-write=lib lib/validate.ts" + "validate": "deno run --allow-env --allow-read=src/_data/reports --allow-write=lib lib/validate.ts", + "lume_debug": "echo \"import 'lume/cli.ts'\" | deno run --inspect-wait --v8-flags=--max-old-space-size=2048 --allow-all -" }, "lock": false, "compilerOptions": { diff --git a/import_map.json b/import_map.json index 6e4f19f98..2e167c33f 100644 --- a/import_map.json +++ b/import_map.json @@ -6,6 +6,6 @@ "lume/": "https://deno.land/x/lume@v1.17.3/", "local/": "./local-lib/", "std/": "https://deno.land/std@0.82.0/", - "oi-lume-utils/": "https://deno.land/x/oi_lume_utils@v0.3.1/" + "oi-lume-utils/": "https://deno.land/x/oi_lume_utils@v0.4.0/" } }