2022-10-25 10:08:41 -04:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
pull_request:
|
2020-12-23 03:26:23 -05:00
|
|
|
name: Test
|
2022-12-02 03:18:47 -05:00
|
|
|
env:
|
2022-12-02 03:26:38 -05:00
|
|
|
GOPROXY: https://proxy.golang.org
|
|
|
|
GO111MODULE: on
|
2023-06-08 10:29:04 -04:00
|
|
|
SASS_VERSION: 1.63.2
|
|
|
|
DART_SASS_SHA_LINUX: 3ea33c95ad5c35fda6e9a0956199eef38a398f496cfb8750e02479d7d1dd42af
|
|
|
|
DART_SASS_SHA_MACOS: 11c70f259836b250b44a9cb57fed70e030f21f45069b467d371685855f1eb4f0
|
|
|
|
DART_SASS_SHA_WINDOWS: cd8cd36a619dd8e27f93d3186c52d70eb7d69472aa6c85f5094b29693e773f64
|
2022-05-03 03:23:47 -04:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2020-12-23 03:26:23 -05:00
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-08-23 12:23:52 -04:00
|
|
|
go-version: [1.20.x,1.21.x]
|
2020-12-23 03:26:23 -05:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
2022-10-05 07:04:36 -04:00
|
|
|
- name: Checkout code
|
2023-05-31 10:00:23 -04:00
|
|
|
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
|
2020-12-23 03:26:23 -05:00
|
|
|
- name: Install Go
|
2023-05-31 10:00:23 -04:00
|
|
|
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
|
2020-12-23 03:26:23 -05:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
2022-10-05 07:04:36 -04:00
|
|
|
check-latest: true
|
2022-10-04 20:09:39 -04:00
|
|
|
cache: true
|
2022-10-05 07:04:36 -04:00
|
|
|
cache-dependency-path: |
|
|
|
|
**/go.sum
|
|
|
|
**/go.mod
|
2020-12-23 03:26:23 -05:00
|
|
|
- name: Install Ruby
|
2022-12-11 12:56:01 -05:00
|
|
|
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4
|
2020-12-23 03:26:23 -05:00
|
|
|
with:
|
2023-08-23 15:58:19 -04:00
|
|
|
ruby-version: '2.7'
|
2022-12-11 12:56:01 -05:00
|
|
|
bundler-cache: true #
|
2020-12-23 03:26:23 -05:00
|
|
|
- name: Install Python
|
|
|
|
uses: actions/setup-python@3105fb18c05ddd93efea5f9e0bef7a03a6e9e7df
|
|
|
|
with:
|
|
|
|
python-version: '3.x'
|
|
|
|
- name: Install Mage
|
2023-05-31 10:00:23 -04:00
|
|
|
run: go install github.com/magefile/mage@v1.15.0
|
2020-12-23 03:26:23 -05:00
|
|
|
- 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: |
|
2022-08-14 02:52:23 -04:00
|
|
|
Choco-Install -PackageName pandoc
|
2020-12-23 03:26:23 -05:00
|
|
|
- run: pandoc -v
|
2022-08-14 02:52:23 -04:00
|
|
|
- if: matrix.os == 'windows-latest'
|
|
|
|
run: |
|
2023-05-31 10:00:23 -04:00
|
|
|
Choco-Install -PackageName mingw -ArgumentList "--version","12.2.0","--allow-downgrade"
|
2020-12-23 03:26:23 -05:00
|
|
|
- if: matrix.os == 'ubuntu-latest'
|
2023-08-23 15:58:19 -04:00
|
|
|
name: Install dart-sass Linux
|
2020-12-23 03:26:23 -05:00
|
|
|
run: |
|
2023-06-08 10:29:04 -04:00
|
|
|
echo "Install Dart Sass version ${SASS_VERSION} ..."
|
|
|
|
curl -LJO "https://github.com/sass/dart-sass/releases/download/${SASS_VERSION}/dart-sass-${SASS_VERSION}-linux-x64.tar.gz";
|
|
|
|
echo "${DART_SASS_SHA_LINUX} dart-sass-${SASS_VERSION}-linux-x64.tar.gz" | sha256sum -c;
|
|
|
|
tar -xvf "dart-sass-${SASS_VERSION}-linux-x64.tar.gz";
|
|
|
|
echo "$GOBIN"
|
|
|
|
echo "$GITHUB_WORKSPACE/dart-sass/" >> $GITHUB_PATH
|
2020-12-23 03:26:23 -05:00
|
|
|
- if: matrix.os == 'macos-latest'
|
2023-08-23 15:58:19 -04:00
|
|
|
name: Install dart-sass MacOS
|
2020-12-23 03:26:23 -05:00
|
|
|
run: |
|
2023-06-08 10:29:04 -04:00
|
|
|
echo "Install Dart Sass version ${SASS_VERSION} ..."
|
|
|
|
curl -LJO "https://github.com/sass/dart-sass/releases/download/${SASS_VERSION}/dart-sass-${SASS_VERSION}-macos-x64.tar.gz";
|
|
|
|
echo "${DART_SASS_SHA_MACOS} dart-sass-${SASS_VERSION}-macos-x64.tar.gz" | shasum -a 256 -c;
|
|
|
|
tar -xvf "dart-sass-${SASS_VERSION}-macos-x64.tar.gz";
|
|
|
|
echo "$GITHUB_WORKSPACE/dart-sass/" >> $GITHUB_PATH
|
2020-12-23 03:26:23 -05:00
|
|
|
- if: matrix.os == 'windows-latest'
|
2023-08-23 15:58:19 -04:00
|
|
|
name: Install dart-sass Windows
|
2020-12-23 03:26:23 -05:00
|
|
|
run: |
|
2023-06-08 10:29:04 -04:00
|
|
|
echo "Install Dart Sass version ${env:SASS_VERSION} ..."
|
|
|
|
curl -LJO "https://github.com/sass/dart-sass/releases/download/${env:SASS_VERSION}/dart-sass-${env:SASS_VERSION}-windows-x64.zip";
|
|
|
|
Expand-Archive -Path "dart-sass-${env:SASS_VERSION}-windows-x64.zip" -DestinationPath .;
|
|
|
|
echo "$env:GITHUB_WORKSPACE/dart-sass/" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf-8 -Append
|
2023-05-31 10:00:23 -04:00
|
|
|
- if: matrix.os != 'windows-latest'
|
|
|
|
name: Check
|
2020-12-23 03:26:23 -05:00
|
|
|
run: |
|
2023-06-08 10:29:04 -04:00
|
|
|
sass --version;
|
2020-12-23 03:26:23 -05:00
|
|
|
mage -v check;
|
2022-05-27 04:06:45 -04:00
|
|
|
env:
|
|
|
|
HUGO_BUILD_TAGS: extended
|
2023-05-31 10:00:23 -04:00
|
|
|
- if: matrix.os == 'windows-latest'
|
|
|
|
# See issue #11052. We limit the build to regular test (no -race flag) on Windows for now.
|
|
|
|
name: Test
|
|
|
|
run: |
|
|
|
|
mage -v test;
|
|
|
|
env:
|
|
|
|
HUGO_BUILD_TAGS: extended
|
2023-06-23 06:09:57 -04:00
|
|
|
- name: Build tags
|
|
|
|
run: |
|
|
|
|
go install -tags extended,nodeploy
|
2023-07-01 10:08:23 -04:00
|
|
|
- if: matrix.os == 'ubuntu-latest'
|
|
|
|
name: Build for dragonfly
|
|
|
|
run: |
|
|
|
|
go install
|
|
|
|
env:
|
|
|
|
GOARCH: amd64
|
|
|
|
GOOS: dragonfly
|