Skip to content

refactor: propagate errors #378

refactor: propagate errors

refactor: propagate errors #378

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:
lint:
name: lint
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
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
- uses: julia-actions/cache@v1
- run: rustup toolchain install stable --profile minimal
- run: rustup component add rustfmt clippy
- name: juliaformatter.jl
run: |
julia -e 'import Pkg; Pkg.add("JuliaFormatter")'
- name: taplo
run: taplo --version
- name: ruff
run: pipx install ruff && ruff --version
- name: sqlfluff
run: pipx 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: pipx install black && black --version
- name: blue
run: pipx install blue && blue --version
- name: yapf
run: pipx install yapf && yapf --version
- name: autopep
run: pipx install autopep8 && autopep8 --version
- name: clang-format
run: pipx install clang-format && clang-format --version
- name: isort
run: pipx install isort && isort --version
- name: usort
run: pipx install usort && usort --version
#- 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 && perltidy --version
- name: goimports
run: go install golang.org/x/tools/cmd/goimports@latest && which goimports
- name: beautysh
run: pipx install beautysh && beautysh --version
- name: cljstyle
run: curl -sLO https://raw.githubusercontent.com/greglook/cljstyle/main/util/install-cljstyle && chmod +x install-cljstyle && sudo ./install-cljstyle && cljstyle version
- name: fourmolu
run: curl -sLO https://github.com/fourmolu/fourmolu/releases/download/v0.15.0.0/fourmolu-0.15.0.0-linux-x86_64 && chmod +x fourmolu-0.15.0.0-linux-x86_64 && sudo mv fourmolu-0.15.0.0-linux-x86_64 /usr/local/bin/fourmolu && fourmolu --version
- name: hindent
run: curl -sSLO https://github.com/mihaimaruseac/hindent/releases/download/v6.1.1/hindent && chmod a+x hindent && sudo mv hindent /usr/local/bin/ && hindent --version
- 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/ && ktlint --version
- name: rufo
run: gem install rufo && rufo --version
- name: yamlfmt
run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest && yamlfmt --version
- name: standardrb
run: gem install standardrb && standardrb --version
- name: fantomas
run: dotnet tool install -g fantomas && fantomas --version
- name: csharpier
run: dotnet tool install -g csharpier && dotnet csharpier --version
- name: xmlformatter/xmlformat
run: pipx install xmlformatter && which xmlformat
- name: yamlfix
run: pipx install yamlfix && yamlfix --version
- name: terraform
run: wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list && sudo apt update && sudo apt install terraform && terraform -version
- name: nixfmt
run: wget https://github.com/NixOS/nixfmt/releases/download/v0.6.0/nixfmt-x86_64-linux && chmod +x nixfmt-x86_64-linux && sudo cp nixfmt-x86_64-linux /usr/local/bin/nixfmt && nixfmt --version
- name: run tests
run: cargo test