Skip to content

Commit

Permalink
ci: add dhall-freeze check
Browse files Browse the repository at this point in the history
  • Loading branch information
ggilmore committed Sep 16, 2020
1 parent ae4338e commit e6fd021
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yaml
Expand Up @@ -41,6 +41,21 @@ jobs:
CHECK: "true"
name: Check that dhall files are formatted
run: just format-dhall
dhallFreeze:
name: dhall-freeze
runs-on: ubuntu-latest
steps:
- uses: "actions/checkout@v2"
- name: Install asdf
uses: "asdf-vm/actions/setup@v1.0.0"
- name: Install asdf plugins
run: "./ci/asdf-add-plugins.sh"
- name: Install asdf tool versions and packages
run: "./ci/asdf-install.sh"
- env:
CHECK: "true"
name: Check that dhall files are frozen
run: just freeze-dhall
dhallLint:
name: dhall-lint
runs-on: ubuntu-latest
Expand Down
19 changes: 19 additions & 0 deletions ci/dhall/jobs/dhall-freeze.dhall
@@ -0,0 +1,19 @@
let GitHubActions = (../imports.dhall).GitHubActions

let Setup = ../setup.dhall

let SetupSteps = Setup.SetupSteps

let Job = Setup.Job

in Job::{
, name = Some "dhall-freeze"
, steps =
SetupSteps
# [ GitHubActions.Step::{
, name = Some "Check that dhall files are frozen"
, run = Some "just freeze-dhall"
, env = Some (toMap { CHECK = "true" })
}
]
}
3 changes: 3 additions & 0 deletions ci/dhall/workflow.dhall
Expand Up @@ -12,6 +12,8 @@ let dhallLint = ./jobs/dhall-lint.dhall

let dhallCheck = ./jobs/dhall-check.dhall

let dhallFreeze = ./jobs/dhall-freeze.dhall

let prettier = ./jobs/prettier.dhall

in GitHubActions.Workflow::{
Expand All @@ -23,6 +25,7 @@ in GitHubActions.Workflow::{
, dhallFormat
, dhallLint
, dhallCheck
, dhallFreeze
, checkPipeline
, prettier
}
Expand Down
4 changes: 4 additions & 0 deletions scripts/dhall-freeze.sh
Expand Up @@ -29,6 +29,10 @@ function check() {
"${file}"
)

if [ "${CHECK:-"false"}" == "true" ]; then
FORMAT_ARGS+=("--check")
fi

result=$(my_chronic "${CHECK_ARGS[@]}" 2>&1)
rc=$?

Expand Down

0 comments on commit e6fd021

Please sign in to comment.