Skip to content

CI

CI #1345

Workflow file for this run

name: CI
on:
push:
branches: [main]
paths-ignore:
- '.github/dependabot.yml'
- '.editorconfig'
- '**.md'
- '.vscode/**'
pull_request:
paths-ignore:
- '.github/dependabot.yml'
- '.editorconfig'
- '**.md'
- '.vscode/**'
schedule:
# Every 10:42 JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '42 1 * * *'
workflow_dispatch:
jobs:
all:
timeout-minutes: 15
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: DeterminateSystems/nix-installer-action@e50d5f73bfe71c2dd0aa4218de8f4afa59f8f81d # v16
- run: nix develop --command echo 'This step should be done before any other "nix develop" steps because of measuring Nix build time'
# See https://github.com/actions/setup-node/blob/802632921f8532d2409ae6eac3313b6f81f11122/src/cache-utils.ts#L30-L38
- name: Get pnpm store path
id: get-pnpm-path
run: |
echo "pnpm-store-path=$(nix develop --command pnpm store path --silent)" | tee -a "$GITHUB_OUTPUT"
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
name: Cache pnpm store
with:
path: |
${{ steps.get-pnpm-path.outputs.pnpm-store-path }}
key: |
pnpm_store-pnpm_${{ hashFiles('pnpm-lock.*') }}-flake_${{ hashFiles('flake.lock') }}-${{ runner.arch }}-${{ runner.os }}
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
name: Cache deno modules
with:
# Using `deno info --json` prints accurate data. However this is a simple solution in this workflow
# See https://github.com/actions/cache/blob/1bd1e32a3bdc45362d1e726936510720a7c30a57/examples.md?plain=1#L144-L155
path: |
~/.cache/deno
key: |
deno_store-deno_${{ hashFiles('deno.lock') }}-flake_${{ hashFiles('flake.lock') }}-${{ runner.arch }}-${{ runner.os }}
- name: Setup
run: |
nix develop --command deno task deps
nix develop --command deno task setup
- name: Test, build, lint
run: |
nix develop --command deno task all
- name: Make sure there is no diff after build
run: |
nix develop --command deno task check_no_git_diff