Skip to content

ci: move schema update to validation action #246

ci: move schema update to validation action

ci: move schema update to validation action #246

Workflow file for this run

name: validate
on:
push:
schedule:
- cron: "0 0 * * 1"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
jobs:
update-schema:
strategy:
matrix:
os:
- ubuntu-latest
node:
- 20
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: rustup toolchain install stable --profile minimal
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: update schema
run: cargo run -- schema
- name: update readme
run: node scripts/update-supported-languages.mjs
- name: format
run: npx prettier --write schemas/ README.md
- uses: EndBug/add-and-commit@v9
with:
message: "chore: update config schema"
lint:
name: lint
needs: [update-schema]
strategy:
matrix:
os:
- windows-latest
- macos-latest
- ubuntu-latest
# TODO: remove once macos-latest is upgraded to an arm machine
- macos-14
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: rustup toolchain install stable --profile minimal
- run: rustup component add rustfmt clippy
- run: cargo fetch
- run: cargo fmt -- --check --color always
- run: cargo clippy
test:
name: test
needs: [update-schema]
strategy:
matrix:
os:
- ubuntu-latest
node:
- 20
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
# gleam_format, mix_format
# NOTE: should be first since it is sometimes crashes (?)
- uses: erlef/setup-beam@v1
with:
otp-version: "26"
gleam-version: "1.0.0"
elixir-version: "1.16.1"
# ruff, sqlfluff, black, blue, yapf, autopep8
- uses: actions/setup-python@v5
with:
cache: "pip"
# biome, prettier, stylua, sql-formatter
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
# nimpretty
- uses: jiro4989/setup-nim-action@v1
# zigfmt
- uses: goto-bus-stop/setup-zig@v2
# taplo
- uses: uncenter/setup-taplo@v1
# shfmt, gofmt, gofumpt
- uses: actions/setup-go@v5
with:
go-version: "stable"
# rubocop
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
# dart_format
- uses: dart-lang/setup-dart@v1
# crystal_format
- uses: crystal-lang/install-crystal@v1
# roc_format
- uses: hasnep/[email protected]
# deno_fmt
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
# just_fmt
- uses: taiki-e/install-action@just
# ocamlformat
#- uses: ocaml/setup-ocaml@v2
# with:
# ocaml-compiler: "5.1"
# scalafmt
- uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
# fourmolo, hindent
- uses: haskell-actions/setup@v2
with:
ghc-version: "latest"
cabal-version: "latest"
cabal-update: true
- run: rustup toolchain install stable --profile minimal
- run: rustup component add rustfmt clippy
- name: taplo
run: taplo --version
- name: ruff
run: pip install ruff && ruff --version
- name: sqlfluff
run: pip install sqlfluff && sqlfluff format --version
- name: biome
run: npx --yes @biomejs/biome --version
- name: prettier
run: npx --yes prettier --version
- name: nimpretty
run: nimpretty --version
- name: zig fmt
run: zig fmt --help
- name: gleam format
run: gleam format --help
- name: mix format
run: mix help format
- name: rubocop
run: gem install rubocop && rubocop --version
- name: stylua
run: cargo install stylua && stylua --version
- name: shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest && shfmt --version
- name: gofumpt
run: go install mvdan.cc/gofumpt@latest && gofumpt --version
- name: black
run: pip install black && black --version
- name: blue
run: pip install blue && blue --version
- name: yapf
run: pip install yapf && yapf --version
- name: autopep
run: pip install autopep8 && autopep8 --version
- name: clang-format
run: pip install clang-format && clang-format --version
- name: isort
run: pip install isort
- name: usort
run: pip install usort
#- name: ocamlformat
# run: eval $(opam env) && opam install ocamlformat && eval $(opam env) && ocamlformat --version
- name: blade-formatter
run: npx --yes blade-formatter --version
- name: crystal_format
run: crystal tool format --help
- name: perltidy
run: sudo apt-get install -y perltidy
- name: goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- name: beautysh
run: pip install beautysh
- name: cljstyle
run: curl -sLO https://raw.githubusercontent.com/greglook/cljstyle/main/util/install-cljstyle && chmod +x install-cljstyle && sudo ./install-cljstyle
- name: fourmolu
run: cabal install fourmolu
- name: hindent
run: cabal install hindent
- name: ktlint
run: curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.2.1/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
- name: rufo
run: gem install rufo
- name: yamlfmt
run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest
- name: run tests
run: cargo test