Skip to content

Calculator

Calculator #198

Workflow file for this run

---
name: Build
# This workflow will install Deno then run `deno fmt`, `deno lint`, and `deno test`.
# For more information see: https://github.com/denoland/setup-deno
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
merge_group:
schedule:
- cron: "0 14 * * 1" # every monday at 9 in the morning CST
workflow_dispatch:
permissions:
contents: read # Needed to clone the repository
env:
CI: true
DENO_VERSION: v1.41.1
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
permissions:
id-token: write # Needed for auth with Deno Deploy
pull-requests: write # Needed for biome comments
steps:
- name: πŸ“š Git checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: recursive
clean: true
persist-credentials: false
set-safe-directory: true
- name: πŸ¦• Install Deno
uses: denoland/setup-deno@041b854f97b325bd60e53e9dc2de9cb9f9ac0cba # v1.1.4
with:
deno-version: ${{ env.DENO_VERSION }}
- name: βš™οΈ Cache Deno dependencies
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: node_modules/
key: deno_cache-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('deno.json') }}
restore-keys: deno_cache-${{ runner.arch }}-${{ runner.os }}
- name: πŸ“¦ Install dependencies
run: deno cache src/main.ts
- name: πŸ•΅οΈ Run linter, verify formatting, typecheck
run: deno task ci
- name: πŸ”¨ Build
run: deno task build
- name: πŸ§ͺ Run tests
run: deno task test
- name: πŸ“Š Collect coverage
run: deno task test:coverage
- name: 🌲 No uncommited changes
uses: infotroph/tree-is-clean@e99ff204c7e1f74fd4de0822e86adb01f2ca2138 # v1.0.4
- name: πŸ”§ Upload to Deno Deploy
id: deno-deploy
uses: denoland/deployctl@1e1637600646cbc6826a4bacd359713fc24d25b3 # 1.11.0
with:
project: "why-switch"
entrypoint: src/main.ts
include: |
src
deno.json
- name: πŸ”¦ Lighthouse
uses: treosh/lighthouse-ci-action@1b0e7c33270fbba31a18a0fbb1de7cc5256b6d39 # 11.4.0
with:
urls: |
${{ steps.deno-deploy.outputs.url }}
${{ steps.deno-deploy.outputs.url }}about/
${{ steps.deno-deploy.outputs.url }}solutions/solar/
${{ steps.deno-deploy.outputs.url }}solutions/geothermal/environment/
uploadArtifacts: true