Skip to content

refs

refs #2014

name: 'quick-test-compile-zoo'
on:
push:
branches: [ "main" ]
pull_request: # run on pull requests!
jobs:
quick-test-compile-zoo:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3
with:
path: ./eczoo_data
# Check out site generation code
- name: Check out eczoo_sitegen code
run: |
git clone https://github.com/errorcorrectionzoo/eczoo_sitegen.git --depth=1 eczoo_sitegen
# --------------------------------
# Install NodeJS
- uses: actions/setup-node@v3
with:
#cache: 'yarn'
node-version: '22'
- name: Corepack enable
run: 'corepack enable'
working-directory: ./eczoo_sitegen/
- name: Yarn version
run: 'yarn --version'
working-directory: ./eczoo_sitegen/
# --------------------------------
#
# SET UP CACHES
#
# Cache Yarn Modules
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
shell: bash
working-directory: ./eczoo_sitegen
- name: Restore yarn modules cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
#restore-keys: |
# yarn-cache-folder-
# Cache citation information (downloaded information & compiled citations)
- name: Restore citations information cache
uses: actions/cache@v3
with:
path: eczoo_sitegen/_zoodb_citations_cache_LOCAL
#key: zoodb-citations-cache-LOCAL-${{ github.sha }}-${{ hashFiles('**/yarn.lock') }}
key: zoodb-citations-cache-LOCAL
#restore-keys: |
# zoodb-citations-cache-LOCAL-
- name: Initialize local citation information cache if applicable
run: |
if [ ! -e _zoodb_citations_cache_LOCAL/cache_downloaded_info.json ]; then
mkdir -p _zoodb_citations_cache_LOCAL/
cp _zoodb_citations_cache/*.json _zoodb_citations_cache_LOCAL/
fi
working-directory: ./eczoo_sitegen
# # Cache Yarn Modules
# - name: Get yarn cache directory path
# id: yarn-cache-dir-path
# run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
# shell: bash
# working-directory: ./eczoo_sitegen
# - name: Restore yarn cache
# uses: actions/cache@v3
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
# restore-keys: |
# yarn-cache-folder-
# --------------------------------
# Install any missing modules
- name: Yarn install
run: 'yarn'
working-directory: ./eczoo_sitegen/
# --------------------------------
- name: Quick build site
run: 'yarn build-simple-noparcel'
working-directory: ./eczoo_sitegen/site/
env:
ECZOO_CITATIONS_CACHE_DIR: "_zoodb_citations_cache_LOCAL"