logseq/.github/workflows/build.yml

95 lines
2.3 KiB
YAML
Raw Normal View History

2020-11-23 08:48:04 +00:00
name: CI
on:
push:
branches: [master]
paths-ignore:
- '*.md'
pull_request:
branches: [master]
paths-ignore:
- '*.md'
env:
CLOJURE_VERSION: '1.10.1.727'
2020-11-23 08:48:04 +00:00
jobs:
2020-11-23 15:00:49 +00:00
test:
2020-11-23 08:48:04 +00:00
strategy:
matrix:
2020-11-23 15:00:49 +00:00
operating-system: [ubuntu-latest]
2020-11-23 08:48:04 +00:00
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
submodules: 'true'
2021-11-25 13:55:01 +00:00
- name: Clojure cache
uses: actions/cache@v2
id: clojure-deps
2020-11-23 15:00:49 +00:00
with:
2021-11-25 13:55:01 +00:00
path: |
~/.m2/repository
~/.gitlibs
key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
restore-keys: ${{ runner.os }}-clojure-deps-
2020-11-23 15:00:49 +00:00
2020-11-23 08:48:04 +00:00
- name: Prepare Java
uses: actions/setup-java@v1
with:
java-version: 1.8
# This is the latest node version of we can run
2020-11-23 15:00:49 +00:00
- name: Set up Node
2021-06-28 13:09:23 +00:00
uses: actions/setup-node@v2
2020-11-23 15:00:49 +00:00
with:
2021-06-28 13:09:23 +00:00
node-version: 16
2020-11-23 15:00:49 +00:00
2020-11-23 08:48:04 +00:00
- name: Install Clojure tools.deps
uses: DeLaGuardo/setup-clojure@master
with:
cli: ${{ env.CLOJURE_VERSION }}
2020-11-23 08:48:04 +00:00
2021-11-25 13:55:01 +00:00
- name: Fetch Clojure deps
if: steps.clojure-deps.outputs.cache-hit != 'true'
2020-11-23 15:00:49 +00:00
run: clojure -A:cljs -P
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: yarn cache
uses: actions/cache@v1
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Fetch yarn deps
2021-03-18 13:16:49 +00:00
run: yarn cache clean && yarn install
2020-11-23 15:00:49 +00:00
- name: Run ClojureScript test
2020-11-23 15:00:49 +00:00
run: |
yarn cljs:test
node static/tests.js
2021-11-23 06:30:49 +00:00
- name: Run Playwright test
run: |
yarn release
(cd static && yarn install && yarn rebuild:better-sqlite3)
xvfb-run -- yarn e2e-test
env:
DEBUG: "pw:test"
- name: Save test artifacts
if: ${{ github.event_name == 'pull_request' && failure() }}
uses: actions/upload-artifact@v2
with:
name: e2e-test-report
path: artifacts.zip