Skip to content

Commit

Permalink
Merge pull request #8 from lambdalisue/up
Browse files Browse the repository at this point in the history
📦 Upgrade dependencies, etc.
  • Loading branch information
lambdalisue authored Nov 15, 2022
2 parents 7bbd3c6 + 35c3b4a commit 0f09c7b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 57 deletions.
72 changes: 34 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,55 @@
name: Test

env:
DENO_VERSION: 1.x

on:
schedule:
- cron: "0 7 * * 0"
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
check:
strategy:
matrix:
runner:
- ubuntu-latest
version:
- "1.x"
- "1.28.x"
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@main
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Lint
run: deno lint

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@main
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Format
deno-version: "${{ matrix.version }}"
- name: Lint check
run: |
make lint
- name: Format check
run: |
deno fmt --check
make fmt-check
- name: Type check
run: |
make type-check
test:
runs-on: ubuntu-latest
strategy:
matrix:
runner:
- windows-latest
- macos-latest
- ubuntu-latest
version:
- "1.x"
- "1.28.x"
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@main
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
deno-version: "${{ matrix.version }}"
- name: Test
run: |
deno test
make test
timeout-minutes: 5

typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: denoland/setup-deno@main
with:
deno-version: ${{ env.DENO_VERSION }}
- name: Type check
run: |
deno test --unstable --no-run ./*.ts
7 changes: 3 additions & 4 deletions .github/workflows/udd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@ jobs:
udd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
with:
deno-version: "1.x"
- name: Update dependencies
run: |
make tools
make update > ../output.txt
make deps > ../output.txt
env:
NO_COLOR: 1
- name: Read ../output.txt
Expand All @@ -36,7 +35,7 @@ jobs:
${{ steps.log.outputs.content }}
EOM
- uses: peter-evans/create-pull-request@v3
- uses: peter-evans/create-pull-request@v4
with:
title: ":package: Update Deno dependencies"
body: |
Expand Down
20 changes: 8 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TOOLS := ${CURDIR}/.tools
TARGETS := $$(find . -name '*.ts' -or -name '*.md')

.DEFAULT_GOAL := help

Expand All @@ -7,27 +7,23 @@ help:
perl -ne 'print if /^\w+.*##/;' | \
perl -pe 's/(.*):.*##\s*/sprintf("%-20s",$$1)/eg;'

tools: FORCE ## Install development tools
@mkdir -p ${TOOLS}
@deno install -A -f -n udd --root ${TOOLS} https://deno.land/x/[email protected]/main.ts

fmt: FORCE ## Format code
@deno fmt --ignore=.deno
@deno fmt

fmt-check: FORCE ## Format check
@deno fmt --check --ignore=.deno
@deno fmt --check

lint: FORCE ## Lint code
@deno lint --ignore=.deno
@deno lint

type-check: FORCE ## Type check
@deno test --unstable --no-run $$(find . -name '*.ts' -not -name '.deno')
@deno test --no-run ${TARGETS}

test: FORCE ## Test
@deno test --no-check --unstable -A --jobs
@deno test -A --no-check

update: FORCE ## Update dependencies
@${TOOLS}/bin/udd $$(find . -name '*.ts' -not -name '.deno')
deps: FORCE ## Update dependencies
@deno run -A https://deno.land/x/[email protected]/main.ts ${TARGETS}
@make fmt

FORCE:
2 changes: 1 addition & 1 deletion builtins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe("range", () => {
() => {
range(0, 1, 0);
},
undefined,
Error,
"range() arg 3 must not be zero",
);
});
Expand Down
4 changes: 2 additions & 2 deletions deps_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { expect } from "https://deno.land/x/[email protected].9/mod.ts";
export * from "https://deno.land/std@0.110.0/testing/asserts.ts";
export { expect } from "https://deno.land/x/[email protected].10/mod.ts";
export * from "https://deno.land/std@0.164.0/testing/asserts.ts";

const currentScopes: string[] = [];

Expand Down

0 comments on commit 0f09c7b

Please sign in to comment.