Skip to content

Commit

Permalink
Move to Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkato committed Mar 22, 2024
1 parent 582f132 commit 2428fb6
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 83 deletions.
52 changes: 0 additions & 52 deletions .circleci/config.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build + Test

on: [push, pull_request]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- run: zip -r Hugo.zip Hugo -x "*.DS_Store"

- name: Upload style to release
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: Hugo.zip

test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Go
uses: actions/setup-go@v5

- name: Install Deps
run: |
wget https://github.com/errata-ai/vale/releases/download/v${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz
mkdir bin && tar -xvzf vale_${VALE_VERSION}_Linux_64-bit.tar.gz -C bin
echo "./bin" >> $GITHUB_PATH
env:
VALE_VERSION: 3.3.0

- name: Features
run: |
zip -r Hugo.zip Hugo -x "*.DS_Store"
cd testdata && ../bin/vale sync && cd -
go test -v ./...
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Hugo.zip
/testdata/styles

# Binaries for programs and plugins
*.exe
*.exe~
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.PHONY: test zip sync

all: test

zip:
zip -r Hugo.zip Hugo -x "*.DS_Store"

sync:
cd testdata && vale sync && cd -

test: zip sync
go test -v ./...
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Hugo

A Vale configuration for Hugo-generated static sites.

## Testing

```
$ make test
```
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Test(t *testing.T) {

path, err := exec.LookPath("vale")
if err != nil {
t.Fatal(err)
path = "./bin/vale"
}

ts.Commands["vale"] = cmdtest.Program(path)
Expand Down
6 changes: 6 additions & 0 deletions testdata/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
StylesPath = styles

Packages = ../Hugo.zip

[*.md]
BasedOnStyles = Vale
11 changes: 11 additions & 0 deletions testdata/shortcodes/test.md → testdata/shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,14 @@ For example:
- {{</* /closecommentedoutshortcode */>}}
- {{%/* commentedoutshortcodemd */%}}
- {{%/* /closecommentedoutshortcodemd */%}}

The unspalsh shortcode:

{{% unsplash name="xxx" href="xxx" %}}

Another unspalsh shortcode:

{{% unsplash
name="xxx"
href="xxx"
%}}
12 changes: 0 additions & 12 deletions testdata/shortcodes/.vale.ini

This file was deleted.

40 changes: 22 additions & 18 deletions testdata/test.ct
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
$ cdf ${ROOTDIR}/shortcodes
$ vale --config .vale.ini --output=line --sort --normalize --relative --no-exit test.md
test.md:1:3:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:3:3:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:8:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:12:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:17:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:21:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:25:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:38:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:42:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:46:1:Vale.Spelling:Did you really mean 'hidecaption'?
test.md:50:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:54:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:58:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:60:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:62:1:Vale.Spelling:Did you really mean 'Shortcodes'?
test.md:64:11:Vale.Spelling:Did you really mean 'shortcodes'?
$ cdf ${ROOTDIR}
$ vale --output=line --sort --normalize --relative --no-exit --no-global shortcodes.md
shortcodes.md:1:3:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:3:3:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:8:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:12:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:17:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:21:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:25:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:38:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:42:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:46:1:Vale.Spelling:Did you really mean 'hidecaption'?
shortcodes.md:50:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:54:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:58:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:60:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:62:1:Vale.Spelling:Did you really mean 'Shortcodes'?
shortcodes.md:64:11:Vale.Spelling:Did you really mean 'shortcodes'?
shortcodes.md:72:5:Vale.Spelling:Did you really mean 'unspalsh'?
shortcodes.md:72:14:Vale.Spelling:Did you really mean 'shortcode'?
shortcodes.md:76:9:Vale.Spelling:Did you really mean 'unspalsh'?
shortcodes.md:76:18:Vale.Spelling:Did you really mean 'shortcode'?

0 comments on commit 2428fb6

Please sign in to comment.