From 48cc6639bfcec92a21f1ce72360e13697c1b2387 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Tue, 23 Mar 2021 22:19:03 +0100 Subject: [PATCH] chore: add CI --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- makefile | 8 ++++++- 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..0115fce1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +name: ci + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + name: test-${{ matrix.os }}-${{ matrix.deno }} + runs-on: ${{ matrix.os }} + + strategy: + matrix: + # Test on the oldest supported, the latest stable, and nightly + deno: [old, stable, canary] + os: [macOS-latest, windows-latest, ubuntu-latest-xl] + + steps: + - name: Setup repo + uses: actions/checkout@v2 + + - name: Setup Deno + run: | + curl -fsSL https://deno.land/x/install/install.sh | sh ${{ matrix.deno == 'old' && '-s v1.8.0' || '' }} + echo "$HOME/.deno/bin" >> $${{ runner.os == 'Windows' && 'env:' || '' }}GITHUB_PATH + + - name: Upgrade to Deno canary + if: matrix.deno == 'canary' + run: deno upgrade --canary + + - run: deno --version + + - name: Format + if: runner.os == 'Linux' + run: deno fmt --check + + - name: Lint + if: runner.os == 'Linux' + run: deno lint --unstable + + - name: Typecheck + run: deno cache deployctl.ts + + # - name: Run tests + # run: deno test -A diff --git a/README.md b/README.md index eb7d27b1..058b0ea6 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,4 @@ deno install --allow-read --allow-write --allow-env --allow-net --allow-run --no ``` deployctl run ./examples/hello.js -``` \ No newline at end of file +``` diff --git a/makefile b/makefile index 9ecb6131..5cf05aaa 100644 --- a/makefile +++ b/makefile @@ -1,3 +1,9 @@ bundle: echo "// Copyright 2021 Deno Land Inc. All rights reserved. MIT license.\n// deno-lint-ignore-file\n// deno-fmt-ignore-file" > src/runtime.bundle.js - deno bundle src/runtime.js >> src/runtime.bundle.js \ No newline at end of file + deno bundle src/runtime.js >> src/runtime.bundle.js + +fmt: + deno fmt + +lint: + deno lint