hugo/.github/workflows/test.yml

90 lines
3.7 KiB
YAML
Raw Normal View History

on: [push, pull_request]
name: Test
2022-05-03 03:23:47 -04:00
permissions:
contents: read
jobs:
test:
env:
GOPROXY: https://proxy.golang.org
GO111MODULE: on
strategy:
matrix:
# Note: We upgraded to Go 1.18 in Hugo v0.95.0
# Go 1.18 had some breaking changes on the source level which means Hugo cannot be built
# with older Go versions, but the improvements in Go 1.18 were too good to pass on (e.g. break and continue).
# Note that you don't need Go (or Go 1.18) to run a pre-built binary.
go-version: [1.18.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8
with:
go-version: ${{ matrix.go-version }}
- name: Install Ruby
uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526
with:
ruby-version: '2.7'
- name: Install Python
uses: actions/setup-python@3105fb18c05ddd93efea5f9e0bef7a03a6e9e7df
with:
python-version: '3.x'
- name: Install Mage
github: Make it build with Go 1.18 I also ran some benchmarks comparing it to Go 1.17.8: ```bash name old time/op new time/op delta SiteNew/Regular_Bundle_with_image-10 5.13ms ± 7% 4.23ms ± 7% -17.47% (p=0.029 n=4+4) SiteNew/Regular_Bundle_with_JSON_file-10 5.12ms ± 1% 4.16ms ± 1% -18.65% (p=0.029 n=4+4) SiteNew/Regular_Tags_and_categories-10 17.3ms ± 2% 15.1ms ± 1% -12.53% (p=0.029 n=4+4) SiteNew/Regular_Canonify_URLs-10 106ms ± 1% 90ms ± 0% -15.86% (p=0.029 n=4+4) SiteNew/Regular_Deep_content_tree-10 34.0ms ± 1% 30.0ms ± 2% -11.72% (p=0.029 n=4+4) SiteNew/Regular_TOML_front_matter-10 22.7ms ± 2% 20.2ms ± 1% -10.93% (p=0.029 n=4+4) SiteNew/Regular_Many_HTML_templates-10 16.7ms ± 0% 14.6ms ± 1% -12.89% (p=0.029 n=4+4) SiteNew/Regular_Page_collections-10 22.2ms ± 1% 19.5ms ± 1% -12.07% (p=0.029 n=4+4) SiteNew/Regular_List_terms-10 7.71ms ± 0% 6.59ms ± 1% -14.52% (p=0.029 n=4+4) name old alloc/op new alloc/op delta SiteNew/Regular_Bundle_with_image-10 2.07MB ± 0% 2.04MB ± 0% -1.40% (p=0.029 n=4+4) SiteNew/Regular_Bundle_with_JSON_file-10 1.85MB ± 0% 1.83MB ± 0% -1.54% (p=0.029 n=4+4) SiteNew/Regular_Tags_and_categories-10 11.8MB ± 0% 11.1MB ± 0% -6.11% (p=0.029 n=4+4) SiteNew/Regular_Canonify_URLs-10 95.8MB ± 0% 95.2MB ± 0% -0.63% (p=0.029 n=4+4) SiteNew/Regular_Deep_content_tree-10 27.4MB ± 0% 26.9MB ± 0% -1.68% (p=0.029 n=4+4) SiteNew/Regular_TOML_front_matter-10 15.2MB ± 0% 14.4MB ± 0% -4.93% (p=0.029 n=4+4) SiteNew/Regular_Many_HTML_templates-10 8.45MB ± 0% 8.24MB ± 0% -2.43% (p=0.029 n=4+4) SiteNew/Regular_Page_collections-10 16.5MB ± 0% 16.2MB ± 0% -1.78% (p=0.029 n=4+4) SiteNew/Regular_List_terms-10 3.73MB ± 0% 3.64MB ± 0% -2.30% (p=0.029 n=4+4) name old allocs/op new allocs/op delta SiteNew/Regular_Bundle_with_image-10 25.0k ± 0% 24.1k ± 0% -3.60% (p=0.029 n=4+4) SiteNew/Regular_Bundle_with_JSON_file-10 25.1k ± 0% 24.1k ± 0% -3.60% (p=0.029 n=4+4) SiteNew/Regular_Tags_and_categories-10 237k ± 0% 234k ± 0% -1.29% (p=0.029 n=4+4) SiteNew/Regular_Canonify_URLs-10 365k ± 0% 363k ± 0% -0.47% (p=0.029 n=4+4) SiteNew/Regular_Deep_content_tree-10 284k ± 0% 279k ± 0% -1.98% (p=0.029 n=4+4) SiteNew/Regular_TOML_front_matter-10 252k ± 0% 249k ± 0% -1.48% (p=0.029 n=4+4) SiteNew/Regular_Many_HTML_templates-10 117k ± 0% 115k ± 0% -1.68% (p=0.029 n=4+4) SiteNew/Regular_Page_collections-10 184k ± 0% 181k ± 0% -1.74% (p=0.029 n=4+4) SiteNew/Regular_List_terms-10 49.9k ± 0% 48.5k ± 0% -2.79% (p=0.029 n=4+4) ```
2022-03-16 05:41:08 -04:00
run: go install github.com/magefile/mage@07afc7d24f4d6d6442305d49552f04fbda5ccb3e
- name: Install asciidoctor
uses: reitzig/actions-asciidoctor@7570212ae20b63653481675fb1ff62d1073632b0
- name: Checkout code
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: Install docutils
run: |
pip install docutils
rst2html.py --version
- if: matrix.os == 'ubuntu-latest'
name: Install pandoc on Linux
run: |
sudo apt-get update -y
sudo apt-get install -y pandoc
- if: matrix.os == 'macos-latest'
run: |
brew install pandoc
- if: matrix.os == 'windows-latest'
run: |
choco install pandoc
- run: pandoc -v
- if: matrix.os == 'ubuntu-latest'
name: Install dart-sass-embedded Linux
run: |
curl -LJO https://github.com/sass/dart-sass-embedded/releases/download/1.0.0-beta.6/sass_embedded-1.0.0-beta.6-linux-x64.tar.gz;
echo "04fc1e5e28d29a4585a701941b6dace56771d94bfbe7f9e4db28d24417ceeec3 sass_embedded-1.0.0-beta.6-linux-x64.tar.gz" | sha256sum -c;
tar -xvf sass_embedded-1.0.0-beta.6-linux-x64.tar.gz;
echo "$GITHUB_WORKSPACE/sass_embedded/" >> $GITHUB_PATH
- if: matrix.os == 'macos-latest'
name: Install dart-sass-embedded MacOS
run: |
curl -LJO https://github.com/sass/dart-sass-embedded/releases/download/1.0.0-beta.6/sass_embedded-1.0.0-beta.6-macos-x64.tar.gz;
echo "b3b984675a9b04aa22f6f2302dda4191b507ac2ca124467db2dfe7e58e72fbad sass_embedded-1.0.0-beta.6-macos-x64.tar.gz" | shasum -a 256 -c;
tar -xvf sass_embedded-1.0.0-beta.6-macos-x64.tar.gz;
echo "$GITHUB_WORKSPACE/sass_embedded/" >> $GITHUB_PATH
- if: matrix.os == 'windows-latest'
name: Install dart-sass-embedded Windows
run: |
curl -LJO https://github.com/sass/dart-sass-embedded/releases/download/1.0.0-beta.6/sass_embedded-1.0.0-beta.6-windows-x64.zip;
echo "6ae442129dbb3334bc21ef851261da6c0c1b560da790ca2e1350871d00ab816d sass_embedded-1.0.0-beta.6-windows-x64.zip" | sha256sum -c;
unzip sass_embedded-1.0.0-beta.6-windows-x64.zip;
echo "$env:GITHUB_WORKSPACE/sass_embedded/" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf-8 -Append
- name: Check
run: |
mage -v check;
env:
HUGO_BUILD_TAGS: extended
- name: Build Docs
env:
HUGO_BUILD_TAGS: extended
HUGO_TIMEOUT: 31000
HUGO_IGNOREERRORS: error-remote-getjson
HUGO_SERVICES_INSTAGRAM_ACCESSTOKEN: dummytoken
run: |
mage -v hugo
./hugo -s docs/
./hugo --renderToMemory -s docs/