Skip to content

Commit

Permalink
Merge pull request #95 from fredrik-bakke/ci-formatting
Browse files Browse the repository at this point in the history
Add autoformatting to CI (for Markdown, YAML, JSON)
  • Loading branch information
fredrik-bakke authored Oct 8, 2023
2 parents 2da5eb4 + a68f43e commit 565122b
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Code autoformatting

on:
push:
branches:
- main

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0

- name: Run Prettier
uses: creyD/[email protected]
with:
prettier_options: --write **/*.{md,json,yaml,yml}
# Update the current commit instead of creating a new one. Only works if checkout fetch depth is set to `0`
same_commit: true
# Prettify changed files. Only works if checkout fetch depth is set to `0`
only_changed: true
9 changes: 6 additions & 3 deletions .github/workflows/rzk.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: Check with latest Rzk
name: Typecheck with latest Rzk

# Controls when the workflow will run
on:
# Triggers the workflow on push events
push:
branches:
- main
# and pull request events
pull_request:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -17,9 +21,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Check all files
- name: Typecheck Rzk files
uses: rzk-lang/rzk-action@v1
with:
rzk-version: latest
# rzk-version: v0.4.1.1 # example of a specific version
files: src/hott/* src/simplicial-hott/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Simplicial HoTT and synthetic ∞-categories

[![Check with latest Rzk](https://github.com/rzk-lang/sHoTT/actions/workflows/rzk.yml/badge.svg)](https://github.com/rzk-lang/sHoTT/actions/workflows/rzk.yml)
[![Typecheck with latest Rzk](https://github.com/rzk-lang/sHoTT/actions/workflows/rzk.yml/badge.svg)](https://github.com/rzk-lang/sHoTT/actions/workflows/rzk.yml)
[![MkDocs to GitHub Pages](https://github.com/rzk-lang/sHoTT/actions/workflows/mkdocs.yml/badge.svg)](https://github.com/rzk-lang/sHoTT/actions/workflows/mkdocs.yml)

> :information_source: This project originated as a fork of
Expand Down

0 comments on commit 565122b

Please sign in to comment.