Cache site builder separately.
This commit is contained in:
parent
19eca137ae
commit
b100c017c6
2 changed files with 32 additions and 13 deletions
31
.github/workflows/build.yml
vendored
31
.github/workflows/build.yml
vendored
|
@ -10,6 +10,7 @@ jobs:
|
|||
matrix:
|
||||
os: [macOS-latest]
|
||||
ghc: ['8.10.5']
|
||||
agda: ['2.6.1.3']
|
||||
|
||||
steps:
|
||||
|
||||
|
@ -25,16 +26,11 @@ jobs:
|
|||
run: |
|
||||
stack config set system-ghc true
|
||||
stack config set install-ghc false
|
||||
shell: bash
|
||||
|
||||
|
||||
# Setup & Cache Haskell
|
||||
|
||||
- name: Get Agda Info
|
||||
id: agda-info
|
||||
run: |
|
||||
echo "::set-output name=agda::$(sed -n -e 's/^.*Agda\s*==\(\S*\)\s*/\1/p' plfa.cabal)"
|
||||
shell: bash
|
||||
|
||||
- name: Cache Haskell
|
||||
uses: actions/cache@v2
|
||||
id: cache-haskell
|
||||
|
@ -45,8 +41,7 @@ jobs:
|
|||
~/.ghcup
|
||||
~/.local
|
||||
~/.stack
|
||||
$GITHUB_WORKSPACE/.stack-work
|
||||
key: ${{ matrix.os }}-ghc-${{ matrix.ghc }}-agda-${{ steps.agda-info.outputs.agda }}
|
||||
key: ${{ matrix.os }}-ghc-${{ matrix.ghc }}
|
||||
|
||||
- name: Setup Haskell
|
||||
if: steps.cache-haskell.outputs.cache-hit != 'true'
|
||||
|
@ -71,6 +66,7 @@ jobs:
|
|||
- name: Setup HTMLProofer
|
||||
if: steps.cache-htmlproofer.outputs.cache-hit != 'true'
|
||||
run: sudo gem install html-proofer
|
||||
shell: bash
|
||||
|
||||
- name: Cache HTMLProofer
|
||||
uses: actions/cache@v2
|
||||
|
@ -81,10 +77,29 @@ jobs:
|
|||
key: ${{ matrix.os }}-ruby-${{ steps.ruby-info.outputs.ruby }}-gem-${{ steps.ruby-info.outputs.gem }}
|
||||
|
||||
|
||||
|
||||
# Setup & Cache site builder
|
||||
|
||||
- name: Cache Site Builder
|
||||
uses: actions/cache@v2
|
||||
id: cache-builder
|
||||
with:
|
||||
path: |
|
||||
$GITHUB_WORKSPACE/.stack-work
|
||||
key: ${{ matrix.os }}-ghc-${{ matrix.ghc }}-agda-${{ matrix.agda }}
|
||||
|
||||
- name: Build Site Builder
|
||||
if: steps.cache-builder.outputs.cache-hit != 'true'
|
||||
run: make build-deps
|
||||
shell: bash
|
||||
|
||||
|
||||
# Build & Test Website
|
||||
|
||||
- name: Build Website
|
||||
run: make build
|
||||
shell: bash
|
||||
|
||||
- name: Test Website
|
||||
run: make test
|
||||
shell: bash
|
||||
|
|
14
Makefile
14
Makefile
|
@ -45,9 +45,13 @@ init: setup-check-fix-whitespace setup-install-htmlproofer
|
|||
# Build PLFA site
|
||||
#################################################################################
|
||||
|
||||
.PHONY: build-deps
|
||||
build-deps:
|
||||
$(STACK) build --only-dependencies
|
||||
|
||||
.PHONY: build
|
||||
build: standard-library/ChangeLog.md
|
||||
@echo "Building site"
|
||||
build: standard-library/ChangeLog.md | build-deps
|
||||
@echo "Building website"
|
||||
$(STACK) build
|
||||
$(STACK) exec site build
|
||||
|
||||
|
@ -83,7 +87,7 @@ test: setup-install-htmlproofer build
|
|||
#################################################################################
|
||||
|
||||
.PHONY: watch
|
||||
watch: standard-library/ChangeLog.md
|
||||
watch: standard-library/ChangeLog.md | build-deps
|
||||
@echo "Watching for changes and rebuilding"
|
||||
$(STACK) build
|
||||
$(STACK) exec site watch
|
||||
|
@ -94,7 +98,7 @@ watch: standard-library/ChangeLog.md
|
|||
#################################################################################
|
||||
|
||||
.PHONY: update-contributors
|
||||
update-contributors:
|
||||
update-contributors: | build-deps
|
||||
@echo "Updating contributors from GitHub"
|
||||
$(STACK) build
|
||||
$(STACK) exec update-contributors
|
||||
|
@ -105,7 +109,7 @@ update-contributors:
|
|||
#################################################################################
|
||||
|
||||
.PHONY: clean
|
||||
clean: standard-library/ChangeLog.md
|
||||
clean: standard-library/ChangeLog.md | build-deps
|
||||
@echo "Cleaning generated files for site"
|
||||
$(STACK) build
|
||||
$(STACK) exec site clean
|
||||
|
|
Loading…
Reference in a new issue