Skip to content

Commit

Permalink
ci: improve
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed Oct 10, 2023
1 parent 3a04bab commit 4ec8e62
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 87 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ jobs:
strategy:
matrix:
task:
- lint
- fmt --check
- test
- ci:check
- ci:test
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
- run: deno task ${{ matrix.task }}
- run: deno task btr ${{ matrix.task }}
analyze:
runs-on: ubuntu-latest
needs:
Expand All @@ -41,4 +40,10 @@ jobs:
- uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: denoland/setup-deno@v1
- run: deno task btr docker:build

91 changes: 55 additions & 36 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,6 @@
"btr": "deno run --allow-env --allow-read --allow-write=.btr.json --allow-run=deno tasks.ts $0"
},
"btr-tasks": {
"deploy:deno": {
"task": [
"deno run source/run/server/mod_imports.ts",
"deployctl deploy --project=metrics --include=source,deno.jsonc --prod source/run/server/mod.ts"
],
"description": "Deploy metrics on https://deno.com/deploy",
"env": {
"DENO_DEPLOY_TOKEN": true
},
"permissions": {
"env": [
// Environment
"DENO_DIR",
"DENO_AUTH_TOKENS",
// Cache
"LOCALAPPDATA"
],
"read": [
// Environment
"$CWD",
// Cache
"$LOCALAPPDATA/deno-wasmbuild",
"$LOCALAPPDATA/deno/deps"
],
"write": [
// Write imports
"source/run/server",
"source/run/server/imports.ts"
],
"net": [
// Packages
"esm.sh"
]
}
},
"serve": {
"task": "deno run source/run/server/mod.ts",
"description": "Run server",
Expand Down Expand Up @@ -172,6 +137,60 @@
"coverage": {
"task": "deno coverage .coverage",
"description": "Print coverage report (require `test` task to be run first)"
},
"ci:check": {
"task": [
"deno lint",
"deno fmt --check"
],
"description": "Lint and format code (CI)",
"lock": false
},
"ci:test": {
"task": [
"deno task btr test",
"deno task btr coverage"
],
"description": "Lint and format code (CI)",
"lock": false
},
"deploy:deno": {
"task": [
"deno run source/run/server/mod_imports.ts",
"deployctl deploy --project=metrics --include=source,deno.jsonc --prod source/run/server/mod.ts"
],
"description": "Deploy metrics on https://deno.com/deploy",
"env": {
"DENO_DEPLOY_TOKEN": true
},
"permissions": {
"env": [
// Environment
"DENO_DIR",
"DENO_AUTH_TOKENS",
// Cache
"LOCALAPPDATA"
],
"read": [
// Environment
"$CWD",
// Cache
"$LOCALAPPDATA/deno-wasmbuild",
"$LOCALAPPDATA/deno/deps"
],
"write": [
// Write imports
"source/run/server",
"source/run/server/imports.ts"
],
"net": [
// Packages
"esm.sh"
]
}
},
"docker:build": {
"task": "docker build --tag lowlighter/metrics:4.0.0 ."
}
},
"lint": {
Expand All @@ -192,7 +211,7 @@
"fmt": {
"lineWidth": 200,
"semiColons": false,
"exclude": ["CODE_OF_CONDUCT.md", ".coverage", "source/run/server/static/app.js", ".legacy"]
"exclude": ["CODE_OF_CONDUCT.md", ".coverage", ".btr.json", "source/run/server/static/app.js", ".legacy"]
},
"compilerOptions": {
"lib": [
Expand Down
Loading

0 comments on commit 4ec8e62

Please sign in to comment.