cut down trad ci.yml by commenting out stuff covered by nix; added cli lint

This commit is contained in:
Quinn Dougherty 2022-08-30 14:16:29 +08:00
parent 3f50cde0a6
commit 83ee5dfb63
4 changed files with 149 additions and 127 deletions

View File

@ -37,6 +37,8 @@ jobs:
run: nix build .#docusaurus-lint run: nix build .#docusaurus-lint
- name: Check that vscode extension lints - name: Check that vscode extension lints
run: nix build .#vscode-lint run: nix build .#vscode-lint
- name: Check that cli lints
run: nix build .#cli-lint
flake-packages: flake-packages:
name: Builds, tests, and bundles name: Builds, tests, and bundles
@ -80,6 +82,6 @@ jobs:
name: quantified-uncertainty name: quantified-uncertainty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build js devshell - name: Build js devshell
run: nix develop .#js -c echo "built js devshell" run: nix develop --profile just-js
- name: Build js & wasm devshell - name: Build js & wasm devshell
run: nix develop -c echo "built js & wasm devshell" run: nix develop --profile full-shell

View File

@ -49,26 +49,26 @@ jobs:
with: with:
paths: '["packages/cli/**"]' paths: '["packages/cli/**"]'
lang-lint: # lang-lint:
name: Language lint # name: Language lint
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: pre_check # needs: pre_check
if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }} # if: ${{ needs.pre_check.outputs.should_skip_lang != 'true' }}
defaults: # defaults:
run: # run:
shell: bash # shell: bash
working-directory: packages/squiggle-lang # working-directory: packages/squiggle-lang
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- name: Install Dependencies # - name: Install Dependencies
run: cd ../../ && yarn # run: cd ../../ && yarn
- name: Check rescript lint # - name: Check rescript lint
run: yarn lint:rescript # run: yarn lint:rescript
- name: Check javascript, typescript, and markdown lint # - name: Check javascript, typescript, and markdown lint
uses: creyD/prettier_action@v4.2 # uses: creyD/prettier_action@v4.2
with: # with:
dry: true # dry: true
prettier_options: --check packages/squiggle-lang # prettier_options: --check packages/squiggle-lang
lang-build-test-bundle: lang-build-test-bundle:
name: Language build, test, and bundle name: Language build, test, and bundle
@ -98,96 +98,96 @@ jobs:
- name: Upload typescript coverage report - name: Upload typescript coverage report
run: yarn coverage:ts:ci run: yarn coverage:ts:ci
components-lint: # components-lint:
name: Components lint # name: Components lint
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: pre_check # needs: pre_check
if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }} # if: ${{ needs.pre_check.outputs.should_skip_components != 'true' }}
defaults: # defaults:
run: # run:
shell: bash # shell: bash
working-directory: packages/components # working-directory: packages/components
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- name: Check javascript, typescript, and markdown lint # - name: Check javascript, typescript, and markdown lint
uses: creyD/prettier_action@v4.2 # uses: creyD/prettier_action@v4.2
with: # with:
dry: true # dry: true
prettier_options: --check packages/components --ignore-path packages/components/.prettierignore # prettier_options: --check packages/components --ignore-path packages/components/.prettierignore
#
# components-bundle-build:
# name: Components bundle and build
# runs-on: ubuntu-latest
# needs: pre_check
# if: ${{ (needs.pre_check.outputs.should_skip_components != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') }}
# defaults:
# run:
# shell: bash
# working-directory: packages/components
# steps:
# - uses: actions/checkout@v3
# - name: Install dependencies from monorepo level
# run: cd ../../ && yarn
# - name: Build rescript codebase in squiggle-lang
# run: cd ../squiggle-lang && yarn build
# - name: Run webpack
# run: yarn bundle
# - name: Build storybook
# run: yarn build
components-bundle-build: # website-lint:
name: Components bundle and build # name: Website lint
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: pre_check # needs: pre_check
if: ${{ (needs.pre_check.outputs.should_skip_components != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') }} # if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }}
defaults: # defaults:
run: # run:
shell: bash # shell: bash
working-directory: packages/components # working-directory: packages/website
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- name: Install dependencies from monorepo level # - name: Check javascript, typescript, and markdown lint
run: cd ../../ && yarn # uses: creyD/prettier_action@v4.2
- name: Build rescript codebase in squiggle-lang # with:
run: cd ../squiggle-lang && yarn build # dry: true
- name: Run webpack # prettier_options: --check packages/website
run: yarn bundle #
- name: Build storybook # website-build:
run: yarn build # name: Website build
# runs-on: ubuntu-latest
website-lint: # needs: pre_check
name: Website lint # if: ${{ (needs.pre_check.outputs.should_skip_website != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') || (needs.pre_check.outputs.should_skip_components != 'true') }}
runs-on: ubuntu-latest # defaults:
needs: pre_check # run:
if: ${{ needs.pre_check.outputs.should_skip_website != 'true' }} # shell: bash
defaults: # working-directory: packages/website
run: # steps:
shell: bash # - uses: actions/checkout@v3
working-directory: packages/website # - name: Install dependencies from monorepo level
steps: # run: cd ../../ && yarn
- uses: actions/checkout@v3 # - name: Build rescript in squiggle-lang
- name: Check javascript, typescript, and markdown lint # run: cd ../squiggle-lang && yarn build
uses: creyD/prettier_action@v4.2 # - name: Build components
with: # run: cd ../components && yarn build
dry: true # - name: Build website assets
prettier_options: --check packages/website # run: yarn build
#
website-build: # vscode-ext-lint:
name: Website build # name: VS Code extension lint
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: pre_check # needs: pre_check
if: ${{ (needs.pre_check.outputs.should_skip_website != 'true') || (needs.pre_check.outputs.should_skip_lang != 'true') || (needs.pre_check.outputs.should_skip_components != 'true') }} # if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }}
defaults: # defaults:
run: # run:
shell: bash # shell: bash
working-directory: packages/website # working-directory: packages/vscode-ext
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- name: Install dependencies from monorepo level # - name: Check javascript, typescript, and markdown lint
run: cd ../../ && yarn # uses: creyD/prettier_action@v4.2
- name: Build rescript in squiggle-lang # with:
run: cd ../squiggle-lang && yarn build # dry: true
- name: Build components # prettier_options: --check packages/vscode-ext
run: cd ../components && yarn build
- name: Build website assets
run: yarn build
vscode-ext-lint:
name: VS Code extension lint
runs-on: ubuntu-latest
needs: pre_check
if: ${{ needs.pre_check.outputs.should_skip_vscodeext != 'true' }}
defaults:
run:
shell: bash
working-directory: packages/vscode-ext
steps:
- uses: actions/checkout@v3
- name: Check javascript, typescript, and markdown lint
uses: creyD/prettier_action@v4.2
with:
dry: true
prettier_options: --check packages/vscode-ext
vscode-ext-build: vscode-ext-build:
name: VS Code extension build name: VS Code extension build
@ -205,19 +205,19 @@ jobs:
- name: Build - name: Build
run: yarn compile run: yarn compile
cli-lint: # cli-lint:
name: CLI lint # name: CLI lint
runs-on: ubuntu-latest # runs-on: ubuntu-latest
needs: pre_check # needs: pre_check
if: ${{ needs.pre_check.outputs.should_skip_cli != 'true' }} # if: ${{ needs.pre_check.outputs.should_skip_cli != 'true' }}
defaults: # defaults:
run: # run:
shell: bash # shell: bash
working-directory: packages/cli # working-directory: packages/cli
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- name: Check javascript, typescript, and markdown lint # - name: Check javascript, typescript, and markdown lint
uses: creyD/prettier_action@v4.2 # uses: creyD/prettier_action@v4.2
with: # with:
dry: true # dry: true
prettier_options: --check packages/cli # prettier_options: --check packages/cli

View File

@ -42,6 +42,10 @@
import ./nix/squiggle-vscode.nix { import ./nix/squiggle-vscode.nix {
inherit pkgs commonFn langFn componentsFn; inherit pkgs commonFn langFn componentsFn;
}; };
cliFn = { pkgs, ... }:
import ./nix/squiggle-cli.nix {
inherit pkgs commonFn;
};
# local machines # local machines
localFlakeOutputs = { pkgs, ... }: localFlakeOutputs = { pkgs, ... }:
@ -50,6 +54,7 @@
components = componentsFn pkgs; components = componentsFn pkgs;
website = websiteFn pkgs; website = websiteFn pkgs;
vscodeext = vscodeextFn pkgs; vscodeext = vscodeextFn pkgs;
cli = cliFn pkgs;
in { in {
# validating # validating
checks = flake-utils.lib.flattenTree { checks = flake-utils.lib.flattenTree {
@ -57,6 +62,7 @@
lang-test = lang.test; lang-test = lang.test;
components-lint = components.lint; components-lint = components.lint;
docusaurus-lint = website.lint; docusaurus-lint = website.lint;
cli-lint = cli.lint;
}; };
# building # building
packages = flake-utils.lib.flattenTree { packages = flake-utils.lib.flattenTree {
@ -71,6 +77,7 @@
components-lint = components.lint; components-lint = components.lint;
docusaurus-lint = website.lint; docusaurus-lint = website.lint;
vscode-lint = vscodeext.lint; vscode-lint = vscodeext.lint;
cli-lint = cli.lint;
}; };
# developing # developing

13
nix/squiggle-cli.nix Normal file
View File

@ -0,0 +1,13 @@
{ pkgs, commonFn }:
rec {
common = commonFn pkgs;
lint = pkgs.stdenv.mkDerivation {
name = "squiggle-cli-lint";
buildInputs = common.buildInputs ++ common.prettier;
src = ../packages/cli;
buildPhase = "prettier --check .";
installPhase = "mkdir -p $out";
};
}