smoke.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Smoke test across OSs: build a Docsy-based site from scratch,
  2. # using Docsy as hugo module and fetching Docsy via NPM.
  3. name: smoke
  4. on:
  5. push:
  6. branches: [main]
  7. pull_request:
  8. # schedule: # midnight every day
  9. # - cron: '0 0 * * *'
  10. workflow_dispatch:
  11. jobs:
  12. new-site:
  13. runs-on: ${{ matrix.os }}
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. os: [windows-latest, ubuntu-latest]
  18. docsy-src: [NPM, HUGO_MODULE]
  19. env:
  20. BASE_REPO: ${{ github.repository }}
  21. BRANCH: ${{ github.head_ref }}
  22. PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}
  23. SHA: ${{ github.sha }}
  24. # TODO: drop PR testing under Windows because it's too slow?
  25. # if: github.event_name != 'pull_request' && matrix.os != 'windows-latest'
  26. if: github.event_name != 'push' || github.repository == 'google/docsy'
  27. steps:
  28. - uses: actions/checkout@v4
  29. - uses: actions/setup-node@v4
  30. with:
  31. node-version-file: .nvmrc
  32. cache: npm
  33. cache-dependency-path: package.json
  34. - run: tools/install-hugo.sh
  35. shell: bash
  36. - name: Make site (non-PR)
  37. if: github.event_name != 'pull_request'
  38. run: |
  39. mkdir tmp && cd tmp && set -x
  40. ../tools/make-site.sh -s ${{ matrix.docsy-src }} -r $BASE_REPO -v $SHA
  41. shell: bash
  42. - name: Make site from PR
  43. if: github.event_name == 'pull_request'
  44. run: |
  45. mkdir tmp && cd tmp && set -x
  46. ../tools/make-site.sh -s ${{ matrix.docsy-src }} -r $PR_REPO -v $BRANCH
  47. shell: bash