hugo/.github/workflows/test.yml

104 lines
4.1 KiB
YAML
Raw Normal View History

2022-10-25 10:08:41 -04:00
on:
push:
branches: [ master ]
pull_request:
name: Test
env:
GOPROXY: https://proxy.golang.org
GO111MODULE: on
2022-12-13 10:09:48 -05:00
DART_SASS_VERSION: 1.56.2
DART_SASS_SHA_LINUX: 9e4f455f7b8619959d7878af2862383be58392eb963a14ff87cc512c03701e2a
DART_SASS_SHA_MACOS: 5992e979e2c30ec363f8e338822bb2b4443c74232b3340501a76180f5652cb09
DART_SASS_SHA_WINDOWS: 8d3d9117c54840e3e6a4919e43acf75ea52f28a64fc87a8e29d80ec72ee36cfb
2022-05-03 03:23:47 -04:00
permissions:
contents: read
jobs:
test:
strategy:
matrix:
go-version: [1.19.x,1.20.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
2022-10-05 10:37:37 -04:00
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- name: Install Go
2022-10-05 10:37:37 -04:00
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache: true
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Install Ruby
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4
with:
ruby-version: '2.7'
bundler-cache: true #
- 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: 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 -PackageName pandoc
- run: pandoc -v
- if: matrix.os == 'windows-latest'
run: |
Choco-Install -PackageName mingw -ArgumentList "--version","10.2.0","--allow-downgrade"
- if: matrix.os == 'ubuntu-latest'
name: Install dart-sass-embedded Linux
run: |
echo "Install Dart Sass version ${DART_SASS_VERSION} ..."
curl -LJO "https://github.com/sass/dart-sass-embedded/releases/download/${DART_SASS_VERSION}/sass_embedded-${DART_SASS_VERSION}-linux-x64.tar.gz";
echo "${DART_SASS_SHA_LINUX} sass_embedded-${DART_SASS_VERSION}-linux-x64.tar.gz" | sha256sum -c;
tar -xvf "sass_embedded-${DART_SASS_VERSION}-linux-x64.tar.gz";
echo "$GITHUB_WORKSPACE/sass_embedded/" >> $GITHUB_PATH
- if: matrix.os == 'macos-latest'
name: Install dart-sass-embedded MacOS
run: |
echo "Install Dart Sass version ${DART_SASS_VERSION} ..."
curl -LJO "https://github.com/sass/dart-sass-embedded/releases/download/${DART_SASS_VERSION}/sass_embedded-${DART_SASS_VERSION}-macos-x64.tar.gz";
echo "${DART_SASS_SHA_MACOS} sass_embedded-${DART_SASS_VERSION}-macos-x64.tar.gz" | shasum -a 256 -c;
tar -xvf "sass_embedded-${DART_SASS_VERSION}-macos-x64.tar.gz";
echo "$GITHUB_WORKSPACE/sass_embedded/" >> $GITHUB_PATH
- if: matrix.os == 'windows-latest'
name: Install dart-sass-embedded Windows
run: |
echo "Install Dart Sass version ${env:DART_SASS_VERSION} ..."
curl -LJO "https://github.com/sass/dart-sass-embedded/releases/download/${env:DART_SASS_VERSION}/sass_embedded-${env:DART_SASS_VERSION}-windows-x64.zip";
Expand-Archive -Path "sass_embedded-${env:DART_SASS_VERSION}-windows-x64.zip" -DestinationPath .;
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/