Skip to content

Commit

Permalink
hof/docs: add gha workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
verdverm committed Feb 26, 2023
1 parent 922ec5e commit 4f8f8bc
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 8 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: docs
"on":
push:
paths:
- docs/**
- ci/gha/docs.cue
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- uses: actions/cache@v3
with:
path: |-
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
~\AppData\Local\go-build
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Vars
id: vars
run: |-
SHA=${GITHUB_SHA::8}
TAG=$(git tag --points-at HEAD)
echo "HOF_FMT_VERSION=${TAG}" >> $GITHUB_ENV
if [ -z $TAG ]; then
TAG=${SHA}
fi
echo "HOF_SHA=${SHA}" >> $GITHUB_ENV
echo "HOF_TAG=${TAG}" >> $GITHUB_ENV
- name: Setup
run: "cd docs\nmake first "
- name: Test
run: make test
- name: Build
run: make build
- name: Check
run: |-
make run &
make broken-link
strategy: {}
services: {}
26 changes: 26 additions & 0 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: release (docs)
"on":
push:
tags:
- docs-*
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Vars
id: vars
run: |-
SHA=${GITHUB_SHA::8}
TAG=$(git tag --points-at HEAD)
echo "HOF_FMT_VERSION=${TAG}" >> $GITHUB_ENV
if [ -z $TAG ]; then
TAG=${SHA}
fi
echo "HOF_SHA=${SHA}" >> $GITHUB_ENV
echo "HOF_TAG=${TAG}" >> $GITHUB_ENV
- name: Setup
run: go install ./cmd/hof
strategy: {}
services: {}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release
name: release (hof)
"on":
push:
tags:
Expand Down
1 change: 1 addition & 0 deletions changelogs/0.6.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ Other changes:
This release has several upgrades systems.

- Refresh of hof mod command to focus on CUE with a simpler implementation using while also using more of the Go implementation
- Improvements to many existing commands and widely used subsystems
- Now using CUE `v0.5.0`


Expand Down
56 changes: 56 additions & 0 deletions ci/gha/docs.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package workflows

import (
"github.com/hofstadter-io/ghacue"
"github.com/hofstadter-io/hof/ci/gha/common"
)

ghacue.#Workflow & {
name: "docs"

on: push: {
paths: ["docs/**", "ci/gha/docs.cue"]
}

jobs: {
docs: {
"runs-on": "ubuntu-latest"
// environment: "hof docs"

steps: [
common.Steps.go.setup & { #ver: "1.20.x" },
common.Steps.go.cache,
common.Steps.checkout,
common.Steps.vars,
{
name: "Setup"
run: """
cd docs
make first
"""
},
{
name: "Test"
run: """
make test
"""
},
{
name: "Build"
run: """
make build
"""
},

{
name: "Check"
run: """
make run &
make broken-link
"""
},
]
}
}
}

32 changes: 32 additions & 0 deletions ci/gha/release-docs.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package workflows

import (
"github.com/hofstadter-io/ghacue"
"github.com/hofstadter-io/hof/ci/gha/common"
)

ghacue.#Workflow & {
name: "release (docs)"

on: push: {
tags: ["docs-*"]
}

jobs: {
docs: {
"runs-on": "ubuntu-latest"
// environment: "hof docs"

steps: [
common.Steps.checkout,
common.Steps.vars,
{
name: "Setup"
run: "go install ./cmd/hof"
},

]
}
}
}

8 changes: 1 addition & 7 deletions ci/gha/release.cue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@ import (
"github.com/hofstadter-io/hof/ci/gha/common"
)

_formatters: [
"prettier",
"csharpier",
"black",
]

ghacue.#Workflow & {
name: "release"
name: "release (hof)"

on: push: {
tags: ["v*"]
Expand Down

0 comments on commit 4f8f8bc

Please sign in to comment.