| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188 |
- name: CI
- on:
- push:
- branches: [master]
- paths-ignore:
- - '*.md'
- pull_request:
- branches: [master]
- paths-ignore:
- - '*.md'
- env:
- CLOJURE_VERSION: '1.10.1.727'
- # setup-java@v2 dropped support for legacy Java version syntax.
- # This is the same as 1.8.
- JAVA_VERSION: '8'
- # This is the latest node version we can run.
- NODE_VERSION: '16'
- BABASHKA_VERSION: '0.7.3'
- jobs:
- test:
- strategy:
- matrix:
- operating-system: [ubuntu-latest]
- runs-on: ${{ matrix.operating-system }}
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Set up Node
- uses: actions/setup-node@v2
- with:
- node-version: ${{ env.NODE_VERSION }}
- cache: 'yarn'
- cache-dependency-path: |
- yarn.lock
- static/yarn.lock
- - name: Set up Java
- uses: actions/setup-java@v2
- with:
- distribution: 'zulu'
- java-version: ${{ env.JAVA_VERSION }}
- - name: Set up Clojure
- uses: DeLaGuardo/setup-clojure@master
- with:
- cli: ${{ env.CLOJURE_VERSION }}
- - name: Clojure cache
- uses: actions/cache@v2
- id: clojure-deps
- with:
- path: |
- ~/.m2/repository
- ~/.gitlibs
- key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
- restore-keys: ${{ runner.os }}-clojure-deps-
- - name: Fetch Clojure deps
- if: steps.clojure-deps.outputs.cache-hit != 'true'
- run: clojure -A:cljs -P
- - name: Fetch yarn deps
- run: yarn install
- # Exits with 0 if yarn.lock is up to date or 1 if we forgot to update it
- - name: Ensure yarn.lock is up to date
- run: git diff --exit-code yarn.lock
- - name: Run ClojureScript test
- run: |
- yarn cljs:test
- node static/tests.js
- lint:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Set up Java
- uses: actions/setup-java@v2
- with:
- distribution: 'zulu'
- java-version: ${{ env.JAVA_VERSION }}
- - name: Set up Clojure
- uses: DeLaGuardo/setup-clojure@master
- with:
- cli: ${{ env.CLOJURE_VERSION }}
- - name: Setup Babashka
- uses: turtlequeue/[email protected]
- with:
- babashka-version: ${{ env.BABASHKA_VERSION }}
- - name: Run clj-kondo lint
- run: clojure -M:clj-kondo --parallel --lint src
- - name: Carve lint for unused vars
- run: scripts/carve.clj
- - name: Lint for vars that are too large
- run: scripts/large_vars.clj
- - name: Lint invalid translation entries
- run: bb lang:invalid-translations
- e2e-test:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Set up Node
- uses: actions/setup-node@v2
- with:
- node-version: ${{ env.NODE_VERSION }}
- cache: 'yarn'
- cache-dependency-path: |
- yarn.lock
- static/yarn.lock
- - name: Set up Java
- uses: actions/setup-java@v2
- with:
- distribution: 'zulu'
- java-version: ${{ env.JAVA_VERSION }}
- - name: Set up Clojure
- uses: DeLaGuardo/setup-clojure@master
- with:
- cli: ${{ env.CLOJURE_VERSION }}
- - name: Clojure cache
- uses: actions/cache@v2
- id: clojure-deps
- with:
- path: |
- ~/.m2/repository
- ~/.gitlibs
- key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
- restore-keys: ${{ runner.os }}-clojure-deps-
- - name: Fetch Clojure deps
- if: steps.clojure-deps.outputs.cache-hit != 'true'
- run: clojure -A:cljs -P
- - name: Shadow-cljs cache
- uses: actions/cache@v2
- with:
- path: .shadow-cljs
- # ensure update cache every time
- key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
- # will match most recent upload
- restore-keys: |
- ${{ runner.os }}-shadow-cljs-
- - name: Fetch yarn deps
- run: yarn install
- env:
- PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
- - name: Prepare E2E test build
- run: |
- yarn gulp:build && yarn cljs:release
- (cd static && yarn install && yarn rebuild:better-sqlite3)
- - name: Run Playwright test
- run: xvfb-run -- yarn e2e-test
- env:
- CI: true
- DEBUG: "pw:test"
- - name: Save test artifacts
- if: ${{ failure() }}
- uses: actions/upload-artifact@v2
- with:
- name: e2e-test-report
- path: artifacts.zip
|