Merge branch 'main' of https://github.com/errorcorrectionzoo/eczoo_data #2921
This file contains hidden or 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: '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/ | |
| # -------------------------------- | |
| # Install Ruby Gems for the 'anystyle' command-line utility. | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.4 | |
| - name: Install AnyStyle.io for parsing manually-formatted citations | |
| run: gem install anystyle-cli | |
| # -------------------------------- | |
| # | |
| # SET UP CACHES | |
| # | |
| # !!!! Make sure "key:" is unique to the setting! A cache hit from the primary key | |
| # causes the cache not to be saved back, as Github assumes that the cache was already | |
| # computed. | |
| # 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') }} | |
| restore-keys: | | |
| zoodb-citations-cache-LOCAL- | |
| - name: Initialize local citation information cache if applicable | |
| run: | | |
| mkdir -p _zoodb_citations_cache_LOCAL | |
| for f in _zoodb_citations_cache/*.json; do | |
| if [ ! -e "_zoodb_citations_cache_LOCAL/$(basename "$f")" ] ; then | |
| echo "Citations cache file ‘$f’ not found, using sitegen repo cache file" | |
| cp "$f" _zoodb_citations_cache_LOCAL/ | |
| fi | |
| done | |
| 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" | |