build.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. name: CI
  2. on:
  3. push:
  4. branches: [master]
  5. paths-ignore:
  6. - '*.md'
  7. pull_request:
  8. branches: [master]
  9. paths-ignore:
  10. - '*.md'
  11. env:
  12. CLOJURE_VERSION: '1.10.1.727'
  13. jobs:
  14. test:
  15. strategy:
  16. matrix:
  17. operating-system: [ubuntu-latest]
  18. runs-on: ${{ matrix.operating-system }}
  19. steps:
  20. - name: Checkout
  21. uses: actions/checkout@v2
  22. with:
  23. fetch-depth: 1
  24. submodules: 'true'
  25. - name: Maven cache
  26. uses: actions/cache@v1
  27. id: maven-cache
  28. with:
  29. path: ~/.m2/repository
  30. key: ${{ runner.os }}-maven-${{ hashFiles('deps.edn') }}
  31. restore-keys: ${{ runner.os }}-maven-
  32. - name: Prepare Java
  33. uses: actions/setup-java@v1
  34. with:
  35. java-version: 1.8
  36. - name: Set up Node
  37. uses: actions/setup-node@v1
  38. with:
  39. node-version: '12'
  40. - name: Check Dockerfile consistency
  41. run: |
  42. DOCKER_VERSION=$(grep -Po 'FROM clojure:.*-deps-?\K(.*)' Dockerfile)
  43. [[ $CLOJURE_VERSION == $DOCKER_VERSION ]] || { echo "Please make sure Docker container version matches CLOJURE_VERSION" && exit 1; }
  44. - name: Install Clojure tools.deps
  45. uses: DeLaGuardo/setup-clojure@master
  46. with:
  47. cli: ${{ env.CLOJURE_VERSION }}
  48. - name: Fetch Maven deps
  49. if: steps.maven-cache.outputs.cache-hit != 'true'
  50. run: clojure -A:cljs -P
  51. - name: Get yarn cache directory path
  52. id: yarn-cache-dir-path
  53. run: echo "::set-output name=dir::$(yarn cache dir)"
  54. - name: yarn cache
  55. uses: actions/cache@v1
  56. id: yarn-cache
  57. with:
  58. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  59. key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
  60. restore-keys: |
  61. ${{ runner.os }}-yarn-
  62. - name: Fetch yarn deps
  63. run: yarn cache clean && yarn install
  64. - name: Run Clojure test
  65. run: |
  66. yarn cljs:test
  67. node static/tests.js