chore:(deps): bump tough-cookie and @cypress/request #470
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '**' | |
tags-ignore: | |
- '**' | |
paths: | |
- '**' | |
env: | |
HUGO_BASIC_EXAMPLE_REPO: 'gohugoio/hugoBasicExample' | |
HUGO_BIN_NAME: 'hugo' | |
HUGO_CACHE_NAME: 'hugo-bin-cache' | |
HUGO_BIN_PATH: ci_hugo_bin | |
HUGO_VERSION_THRESHOLD: '0.103.0' | |
HTMLTEST_BIN_NAME: htmltest | |
HTMLTEST_CACHE_NAME: 'htmltest-bin-cache' | |
HTMLTEST_BIN_PATH: ci_htmltest_bin | |
HUGO_TESTS_VERSIONS: '0.112.0 0.115.4' | |
CYPRESS_CACHE_NAME: 'cypress-cache' | |
CYPRESS_CACHE_PATH: '~/.cache' | |
NPM_CACHE_NAME: 'npm-cache' | |
NPM_CACHE_PATH: '~/.npm' | |
jobs: | |
hugo-binaries: | |
name: Manage Hugo binaries | |
runs-on: macos-latest | |
steps: | |
- name: Manage Hugo cache key | |
run: echo ${HUGO_TESTS_VERSIONS} > ${HUGO_CACHE_NAME} | |
- name: Cache Hugo binaries | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.HUGO_BIN_PATH }} | |
key: ${{ env.HUGO_CACHE_NAME }}-${{ hashFiles(format('{0}', env.HUGO_CACHE_NAME)) }} | |
- name: Add temporary binaries to PATH | |
run: echo "${HUGO_BIN_PATH}" >> ${GITHUB_PATH} | |
- name: Download Hugo binaries | |
run: | | |
ABS_HUGO_BIN_PATH=${GITHUB_WORKSPACE}/${HUGO_BIN_PATH} | |
for hugoVersion in ${HUGO_TESTS_VERSIONS[@]}; do | |
if [ ! -d "${ABS_HUGO_BIN_PATH}" ]; then | |
mkdir -p ${ABS_HUGO_BIN_PATH} | |
fi | |
if [ ! -f "${ABS_HUGO_BIN_PATH}/${HUGO_BIN_NAME}_${hugoVersion}" ]; then | |
printf "%70s\n" | tr ' ' '-' | |
printf "%-60s%10s\n" "-> Downloading Hugo version:" "${hugoVersion}" | |
printf "%70s\n" | tr ' ' '-' | |
if [ "${HUGO_VERSION_THRESHOLD}" = "$(printf "%s\n%s" "${HUGO_VERSION_THRESHOLD}" "${hugoVersion}" | sort -V | head -n1)" ]; then | |
HUGO_BIN="hugo_extended_${hugoVersion}_darwin-universal.tar.gz" | |
else | |
HUGO_BIN="hugo_extended_${hugoVersion}_macOS-64bit.tar.gz" | |
fi | |
HUGO_URL_BIN="https://github.com/gohugoio/hugo/releases/download/v${hugoVersion}/${HUGO_BIN}" | |
(cd ${ABS_HUGO_BIN_PATH} && curl -sLO -H "Accept: application/octet-stream" ${HUGO_URL_BIN}) | |
tar -xf ${ABS_HUGO_BIN_PATH}/${HUGO_BIN} -C ${ABS_HUGO_BIN_PATH} | |
mv ${ABS_HUGO_BIN_PATH}/${HUGO_BIN_NAME} ${ABS_HUGO_BIN_PATH}/${HUGO_BIN_NAME}_${hugoVersion} | |
cd ${GITHUB_WORKSPACE} | |
rm -f ${ABS_HUGO_BIN_PATH}/${HUGO_BIN} | |
fi | |
printf "%70s\n" | tr ' ' '-' | |
${HUGO_BIN_NAME}_${hugoVersion} version | |
printf "%70s\n" | tr ' ' '-' | |
done | |
test-theme-hugo: | |
needs: hugo-binaries | |
name: Test theme against Hugo versions | |
runs-on: macos-latest | |
steps: | |
- name: Checkout theme repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 1 | |
- name: Checkout hugoBasicExample repository | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{ env.HUGO_BASIC_EXAMPLE_REPO }} | |
path: ${{ env.HUGO_BASIC_EXAMPLE_REPO }} | |
fetch-depth: 1 | |
- name: Manage Hugo cache key | |
run: echo ${HUGO_TESTS_VERSIONS} > ${HUGO_CACHE_NAME} | |
- name: Cache Hugo binaries | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.HUGO_BIN_PATH }} | |
key: ${{ env.HUGO_CACHE_NAME }}-${{ hashFiles(format('{0}', env.HUGO_CACHE_NAME)) }} | |
- name: Add temporary binaries to PATH | |
run: echo "${HUGO_BIN_PATH}" >> ${GITHUB_PATH} | |
- name: Build theme against Hugo versions | |
run: | | |
for hugoVersion in ${HUGO_TESTS_VERSIONS[@]}; do | |
printf "%70s\n" | tr ' ' '-' | |
printf "%-60s%10s\n" "-> Checking theme against Hugo version:" "${hugoVersion}" | |
printf "%70s\n" | tr ' ' '-' | |
${HUGO_BIN_NAME}_${hugoVersion} version | |
${HUGO_BIN_NAME}_${hugoVersion} -s exampleSite | |
done | |
- name: Check theme against hugoBasicExample and Hugo versions | |
run: | | |
for hugoVersion in ${HUGO_TESTS_VERSIONS[@]}; do | |
printf "%70s\n" | tr ' ' '-' | |
printf "%-70s\n" "-> Checking theme against hugoBasicExample" | |
printf "%70s\n" | tr ' ' '-' | |
${HUGO_BIN_NAME}_${hugoVersion} version | |
${HUGO_BIN_NAME}_${hugoVersion} -s ${HUGO_BASIC_EXAMPLE_REPO} -t ../../../ | |
done | |
test-theme-links: | |
needs: hugo-binaries | |
name: Test theme links | |
runs-on: macos-latest | |
steps: | |
- name: Checkout theme repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 1 | |
- name: Manage Hugo cache key | |
run: echo ${HUGO_TESTS_VERSIONS} > ${HUGO_CACHE_NAME} | |
- name: Cache Hugo binaries | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.HUGO_BIN_PATH }} | |
key: ${{ env.HUGO_CACHE_NAME }}-${{ hashFiles(format('{0}', env.HUGO_CACHE_NAME)) }} | |
- name: Cache Htmltest | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.HTMLTEST_BIN_PATH }} | |
key: ${{ env.HTMLTEST_CACHE_NAME }}-${{ hashFiles(format('{0}{1}{2}', env.HTMLTEST_CACHE_NAME, '/', env.HTMLTEST_BIN_NAME)) }} | |
- name: Add temporary binaries to PATH | |
run: | | |
echo "${HUGO_BIN_PATH}" >> ${GITHUB_PATH} | |
echo "${HTMLTEST_BIN_PATH}" >> ${GITHUB_PATH} | |
- name: Download Htmltest binary | |
run: | | |
ABS_HTMLTEST_BIN_PATH=${GITHUB_WORKSPACE}/${HTMLTEST_BIN_PATH} | |
if [ ! -d "${ABS_HTMLTEST_BIN_PATH}" ]; then | |
mkdir -p ${ABS_HTMLTEST_BIN_PATH} | |
fi | |
if [ ! -f "${ABS_HTMLTEST_BIN_PATH}/${HTMLTEST_BIN_NAME}" ]; then | |
printf "%70s\n" | tr ' ' '-' | |
printf "%-60s%10s\n" "-> Downloading Htmltest" | |
printf "%70s\n" | tr ' ' '-' | |
HTMLTEST_URL_BIN=$(curl -XGET -H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -s https://api.github.com/repos/wjdp/htmltest/releases/latest | jq -r '.assets[]|select(.name | test(".*_macos_amd64.tar.gz")).browser_download_url') | |
HTMLTEST_BIN=${HTMLTEST_URL_BIN##*/} | |
(cd ${ABS_HTMLTEST_BIN_PATH} && curl -sLO -H "Accept: application/octet-stream" ${HTMLTEST_URL_BIN}) | |
tar -xf ${ABS_HTMLTEST_BIN_PATH}/${HTMLTEST_BIN} -C ${ABS_HTMLTEST_BIN_PATH} | |
cd ${GITHUB_WORKSPACE} | |
rm -f ${ABS_HTMLTEST_BIN_PATH}/${HTMLTEST_BIN} | |
fi | |
printf "%70s\n" | tr ' ' '-' | |
${HTMLTEST_BIN_NAME} --version | |
printf "%70s\n" | tr ' ' '-' | |
- name: Build Hugo static files | |
run: | | |
mv ${GITHUB_WORKSPACE}/${HUGO_BIN_PATH}/${HUGO_BIN_NAME}_${HUGO_TESTS_VERSIONS##* } ${GITHUB_WORKSPACE}/${HUGO_BIN_PATH}/${HUGO_BIN_NAME} | |
hugo -s exampleSite/ -b "localhost:1313" | |
- name: Run htmltest | |
run: htmltest | |
test-theme-chrome: | |
needs: hugo-binaries | |
name: Test theme against Chrome | |
runs-on: macos-latest | |
steps: | |
- name: Checkout theme repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 1 | |
- name: Manage Hugo cache key | |
run: echo ${HUGO_TESTS_VERSIONS} > ${HUGO_CACHE_NAME} | |
- name: Cache Hugo binaries | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.HUGO_BIN_PATH }} | |
key: ${{ env.HUGO_CACHE_NAME }}-${{ hashFiles(format('{0}', env.HUGO_CACHE_NAME)) }} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.NPM_CACHE_PATH }} | |
key: ${{ runner.os }}-${{ env.NPM_CACHE_NAME }}-${{ hashFiles('package-lock.json') }} | |
- name: Cache Cypress binary | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.CYPRESS_CACHE_PATH }} | |
key: ${{ runner.os }}-${{ env.CYPRESS_CACHE_NAME }}-${{ hashFiles('package-lock.json') }} | |
- name: Add temporary binaries to PATH | |
run: echo "${HUGO_BIN_PATH}" >> ${GITHUB_PATH} | |
- name: Prepare e2e tests | |
run: | | |
printf "%70s\n" | tr ' ' '-' | |
npm ci | |
printf "%70s\n" | tr ' ' '-' | |
npx cypress verify | |
npx cypress info | |
npx cypress version | |
npx cypress version --component package | |
npx cypress version --component binary | |
npx cypress version --component electron | |
npx cypress version --component node | |
printf "%70s\n" | tr ' ' '-' | |
- name: Execute e2e tests (Chrome) | |
run: | | |
printf "%70s\n" | tr ' ' '-' | |
mv ${GITHUB_WORKSPACE}/${HUGO_BIN_PATH}/${HUGO_BIN_NAME}_${HUGO_TESTS_VERSIONS##* } ${GITHUB_WORKSPACE}/${HUGO_BIN_PATH}/${HUGO_BIN_NAME} | |
npm run cy:run:chrome | |
printf "%70s\n" | tr ' ' '-' | |
test-theme-firefox: | |
needs: hugo-binaries | |
name: Test theme against Firefox | |
runs-on: macos-latest | |
steps: | |
- name: Checkout theme repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 1 | |
- name: Manage Hugo cache key | |
run: echo ${HUGO_TESTS_VERSIONS} > ${HUGO_CACHE_NAME} | |
- name: Cache Hugo binaries | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.HUGO_BIN_PATH }} | |
key: ${{ env.HUGO_CACHE_NAME }}-${{ hashFiles(format('{0}', env.HUGO_CACHE_NAME)) }} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.NPM_CACHE_PATH }} | |
key: ${{ runner.os }}-${{ env.NPM_CACHE_NAME }}-${{ hashFiles('package-lock.json') }} | |
- name: Cache Cypress binary | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.CYPRESS_CACHE_PATH }} | |
key: ${{ runner.os }}-${{ env.CYPRESS_CACHE_NAME }}-${{ hashFiles('package-lock.json') }} | |
- name: Add temporary binaries to PATH | |
run: echo "${HUGO_BIN_PATH}" >> ${GITHUB_PATH} | |
- name: Prepare e2e tests | |
run: | | |
printf "%70s\n" | tr ' ' '-' | |
npm ci | |
printf "%70s\n" | tr ' ' '-' | |
npx cypress verify | |
npx cypress info | |
npx cypress version | |
npx cypress version --component package | |
npx cypress version --component binary | |
npx cypress version --component electron | |
npx cypress version --component node | |
printf "%70s\n" | tr ' ' '-' | |
- name: Execute e2e tests (Firefox) | |
run: | | |
printf "%70s\n" | tr ' ' '-' | |
mv ${GITHUB_WORKSPACE}/${HUGO_BIN_PATH}/${HUGO_BIN_NAME}_${HUGO_TESTS_VERSIONS##* } ${GITHUB_WORKSPACE}/${HUGO_BIN_PATH}/${HUGO_BIN_NAME} | |
npm run cy:run:firefox | |
printf "%70s\n" | tr ' ' '-' | |
test-theme-edge: | |
needs: hugo-binaries | |
name: Test theme against Edge | |
runs-on: macos-latest | |
steps: | |
- name: Checkout theme repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 1 | |
- name: Manage Hugo cache key | |
run: echo ${HUGO_TESTS_VERSIONS} > ${HUGO_CACHE_NAME} | |
- name: Cache Hugo binaries | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.HUGO_BIN_PATH }} | |
key: ${{ env.HUGO_CACHE_NAME }}-${{ hashFiles(format('{0}', env.HUGO_CACHE_NAME)) }} | |
- name: Cache node modules | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.NPM_CACHE_PATH }} | |
key: ${{ runner.os }}-${{ env.NPM_CACHE_NAME }}-${{ hashFiles('package-lock.json') }} | |
- name: Cache Cypress binary | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.CYPRESS_CACHE_PATH }} | |
key: ${{ runner.os }}-${{ env.CYPRESS_CACHE_NAME }}-${{ hashFiles('package-lock.json') }} | |
- name: Add temporary binaries to PATH | |
run: echo "${HUGO_BIN_PATH}" >> ${GITHUB_PATH} | |
- name: Prepare e2e tests | |
run: | | |
printf "%70s\n" | tr ' ' '-' | |
npm ci | |
printf "%70s\n" | tr ' ' '-' | |
npx cypress verify | |
npx cypress info | |
npx cypress version | |
npx cypress version --component package | |
npx cypress version --component binary | |
npx cypress version --component electron | |
npx cypress version --component node | |
printf "%70s\n" | tr ' ' '-' | |
- name: Execute e2e tests (Edge) | |
run: | | |
printf "%70s\n" | tr ' ' '-' | |
mv ${GITHUB_WORKSPACE}/${HUGO_BIN_PATH}/${HUGO_BIN_NAME}_${HUGO_TESTS_VERSIONS##* } ${GITHUB_WORKSPACE}/${HUGO_BIN_PATH}/${HUGO_BIN_NAME} | |
npm run cy:run:edge | |
printf "%70s\n" | tr ' ' '-' |