mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
d894269855
Closes #10517
107 lines
4.5 KiB
YAML
107 lines
4.5 KiB
YAML
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
name: Test
|
|
env:
|
|
GOPROXY: https://proxy.golang.org
|
|
GO111MODULE: on
|
|
DART_SASS_VERSION: 1.56.1
|
|
DART_SASS_SHA_LINUX: c6dd75ab1acb2cab98982a32622c0ba631cfaa753e7bac84efd32c6c19ea9303
|
|
DART_SASS_SHA_MACOS: df6f4813501f906ffc8f8af865452b037bc1c3a17448c4b8ffa3be82793eb0c8
|
|
DART_SASS_SHA_WINDOWS: c8bf9c009afd6bbeb1742e010845b84e1021fdba6edc80b4dd1fbbee75354b39
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
test:
|
|
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,1.19.x]
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
|
- name: Install Go
|
|
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
|
|
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/
|