2020-11-23 08:48:04 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-02-22 15:35:03 +00:00
|
|
|
branches: [master]
|
2020-11-23 08:48:04 +00:00
|
|
|
paths-ignore:
|
|
|
|
- '*.md'
|
|
|
|
pull_request:
|
|
|
|
branches: [master]
|
|
|
|
paths-ignore:
|
|
|
|
- '*.md'
|
|
|
|
|
2021-04-08 17:15:54 +00:00
|
|
|
env:
|
2023-02-21 15:02:58 +00:00
|
|
|
CLOJURE_VERSION: '1.10.1.763'
|
|
|
|
JAVA_VERSION: '11'
|
2022-01-13 21:35:18 +00:00
|
|
|
# This is the latest node version we can run.
|
2023-02-21 15:07:35 +00:00
|
|
|
NODE_VERSION: '18'
|
2022-12-08 16:22:01 +00:00
|
|
|
BABASHKA_VERSION: '1.0.168'
|
2021-04-08 17:15:54 +00:00
|
|
|
|
2020-11-23 08:48:04 +00:00
|
|
|
jobs:
|
2023-02-20 11:44:01 +00:00
|
|
|
typos:
|
|
|
|
name: Spell Check with Typos
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Actions Repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Check spelling with custom config file
|
|
|
|
uses: crate-ci/typos@v1.13.10
|
|
|
|
with:
|
|
|
|
config: ./typos.toml
|
2020-11-23 08:48:04 +00:00
|
|
|
|
2022-01-13 14:40:43 +00:00
|
|
|
test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
operating-system: [ubuntu-latest]
|
|
|
|
|
|
|
|
runs-on: ${{ matrix.operating-system }}
|
2020-11-23 08:48:04 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-01-21 13:10:19 +00:00
|
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
|
2022-01-13 03:57:51 +00:00
|
|
|
|
|
|
|
- name: Set up Node
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: actions/setup-node@v3
|
2022-01-13 03:57:51 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
cache: 'yarn'
|
|
|
|
cache-dependency-path: |
|
|
|
|
yarn.lock
|
|
|
|
static/yarn.lock
|
|
|
|
|
|
|
|
- name: Set up Java
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: actions/setup-java@v3
|
2022-01-13 03:57:51 +00:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
|
|
|
|
|
|
- name: Set up Clojure
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: DeLaGuardo/setup-clojure@10.1
|
2020-11-23 08:48:04 +00:00
|
|
|
with:
|
2022-01-13 03:57:51 +00:00
|
|
|
cli: ${{ env.CLOJURE_VERSION }}
|
2020-11-23 08:48:04 +00:00
|
|
|
|
2021-11-25 13:55:01 +00:00
|
|
|
- name: Clojure cache
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: actions/cache@v3
|
2021-11-25 13:55:01 +00:00
|
|
|
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-
|
2022-01-24 21:41:07 +00:00
|
|
|
|
2022-01-13 03:57:51 +00:00
|
|
|
- name: Fetch Clojure deps
|
|
|
|
if: steps.clojure-deps.outputs.cache-hit != 'true'
|
|
|
|
run: clojure -A:cljs -P
|
2020-11-23 15:00:49 +00:00
|
|
|
|
2022-01-13 03:57:51 +00:00
|
|
|
- name: Fetch yarn deps
|
2022-04-12 06:06:03 +00:00
|
|
|
run: yarn install --frozen-lockfile
|
2022-02-22 15:29:48 +00:00
|
|
|
|
2022-05-10 16:20:02 +00:00
|
|
|
- name: Run ClojureScript tests
|
2022-01-13 03:57:51 +00:00
|
|
|
run: |
|
|
|
|
yarn cljs:test
|
2022-06-08 05:06:10 +00:00
|
|
|
node static/tests.js
|
2022-01-13 03:57:51 +00:00
|
|
|
|
2022-01-27 22:40:11 +00:00
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-01-21 13:10:19 +00:00
|
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3
|
2022-01-27 22:40:11 +00:00
|
|
|
|
2022-01-24 21:41:07 +00:00
|
|
|
- name: Set up Java
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: actions/setup-java@v3
|
2022-01-24 21:41:07 +00:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
|
|
|
|
|
|
- name: Set up Clojure
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: DeLaGuardo/setup-clojure@10.1
|
2022-01-24 21:41:07 +00:00
|
|
|
with:
|
|
|
|
cli: ${{ env.CLOJURE_VERSION }}
|
2022-11-30 05:23:06 +00:00
|
|
|
bb: ${{ env.BABASHKA_VERSION }}
|
2022-01-27 22:40:11 +00:00
|
|
|
|
2022-01-24 21:41:07 +00:00
|
|
|
- name: Run clj-kondo lint
|
|
|
|
run: clojure -M:clj-kondo --parallel --lint src
|
|
|
|
|
|
|
|
- name: Carve lint for unused vars
|
2022-10-10 05:14:50 +00:00
|
|
|
run: bb lint:carve 2>/dev/null
|
2022-01-24 21:41:07 +00:00
|
|
|
|
2022-02-04 18:52:46 +00:00
|
|
|
- name: Lint for vars that are too large
|
2022-10-10 05:14:50 +00:00
|
|
|
run: bb lint:large-vars 2>/dev/null
|
2022-02-04 18:52:46 +00:00
|
|
|
|
2022-09-23 01:13:06 +00:00
|
|
|
- name: Lint for namespaces that aren't documented
|
2022-10-10 05:14:50 +00:00
|
|
|
run: bb lint:ns-docstrings 2>/dev/null
|
2022-09-23 01:13:06 +00:00
|
|
|
|
2022-02-02 16:26:20 +00:00
|
|
|
- name: Lint invalid translation entries
|
2023-02-24 14:21:57 +00:00
|
|
|
run: bb lang:validate-translations
|
2022-01-27 22:40:11 +00:00
|
|
|
|
2022-01-13 03:57:51 +00:00
|
|
|
e2e-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-01-21 13:10:19 +00:00
|
|
|
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
|
2020-11-23 08:48:04 +00:00
|
|
|
|
2020-11-23 15:00:49 +00:00
|
|
|
- name: Set up Node
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: actions/setup-node@v3
|
2020-11-23 15:00:49 +00:00
|
|
|
with:
|
2022-01-13 03:57:51 +00:00
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
cache: 'yarn'
|
|
|
|
cache-dependency-path: |
|
|
|
|
yarn.lock
|
|
|
|
static/yarn.lock
|
|
|
|
|
|
|
|
- name: Set up Java
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: actions/setup-java@v3
|
2022-01-13 03:57:51 +00:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: ${{ env.JAVA_VERSION }}
|
2020-11-23 15:00:49 +00:00
|
|
|
|
2022-01-13 03:57:51 +00:00
|
|
|
- name: Set up Clojure
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: DeLaGuardo/setup-clojure@10.1
|
2020-11-23 08:48:04 +00:00
|
|
|
with:
|
2021-04-08 17:15:54 +00:00
|
|
|
cli: ${{ env.CLOJURE_VERSION }}
|
2020-11-23 08:48:04 +00:00
|
|
|
|
2022-01-13 03:57:51 +00:00
|
|
|
- name: Clojure cache
|
2023-02-21 15:02:58 +00:00
|
|
|
uses: actions/cache@v3
|
2022-01-13 03:57:51 +00:00
|
|
|
id: clojure-deps
|
2022-01-11 22:41:04 +00:00
|
|
|
with:
|
2022-01-13 03:57:51 +00:00
|
|
|
path: |
|
|
|
|
~/.m2/repository
|
|
|
|
~/.gitlibs
|
|
|
|
key: ${{ runner.os }}-clojure-deps-${{ hashFiles('deps.edn') }}
|
|
|
|
restore-keys: ${{ runner.os }}-clojure-deps-
|
2022-01-11 22:41: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
|
|
|
|
|
2022-01-13 03:57:51 +00:00
|
|
|
- name: Shadow-cljs cache
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: actions/cache@v3
|
2020-11-23 15:00:49 +00:00
|
|
|
with:
|
2022-01-13 03:57:51 +00:00
|
|
|
path: .shadow-cljs
|
|
|
|
# ensure update cache every time
|
|
|
|
key: ${{ runner.os }}-shadow-cljs-${{ github.sha }}
|
|
|
|
# will match most recent upload
|
2020-11-23 15:00:49 +00:00
|
|
|
restore-keys: |
|
2022-01-13 03:57:51 +00:00
|
|
|
${{ runner.os }}-shadow-cljs-
|
2020-11-23 15:00:49 +00:00
|
|
|
|
2022-01-13 03:57:51 +00:00
|
|
|
- name: Fetch yarn deps
|
|
|
|
run: yarn install
|
|
|
|
env:
|
|
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
|
2022-01-11 22:41:04 +00:00
|
|
|
|
2022-04-15 11:50:25 +00:00
|
|
|
# NOTE: require the app to be build in debug mode(compile instead of build).
|
2022-01-13 03:57:51 +00:00
|
|
|
- name: Prepare E2E test build
|
2020-11-23 15:00:49 +00:00
|
|
|
run: |
|
2022-04-15 11:50:25 +00:00
|
|
|
yarn gulp:build && clojure -M:cljs compile app publishing electron
|
2022-12-01 03:21:05 +00:00
|
|
|
(cd static && yarn install && yarn rebuild:all)
|
2021-11-23 06:30:49 +00:00
|
|
|
|
2022-03-18 15:04:47 +00:00
|
|
|
# Exits with 0 if yarn.lock is up to date or 1 if we forgot to update it
|
|
|
|
- name: Ensure static yarn.lock is up to date
|
|
|
|
run: git diff --exit-code static/yarn.lock
|
|
|
|
|
2023-05-22 09:41:31 +00:00
|
|
|
- name: Install fluxbox
|
2023-05-22 10:11:46 +00:00
|
|
|
run: sudo apt-get update && sudo apt-get install -y fluxbox
|
2023-05-22 09:41:31 +00:00
|
|
|
|
2023-05-22 11:10:08 +00:00
|
|
|
- name: Export display
|
|
|
|
run: export DISPLAY=:99
|
|
|
|
|
2022-11-29 18:12:21 +00:00
|
|
|
- name: Run Playwright test - 1/2
|
2023-05-22 11:10:08 +00:00
|
|
|
run: Xvfb :99 -screen 0 1024x768x16 & fluxbox & npx playwright test --reporter github --shard=1/2
|
2021-11-23 06:30:49 +00:00
|
|
|
env:
|
2022-11-29 16:42:27 +00:00
|
|
|
LOGSEQ_CI: true
|
2022-07-06 14:01:42 +00:00
|
|
|
DEBUG: "pw:api"
|
2022-11-29 18:12:21 +00:00
|
|
|
RELEASE: true # skip dev only test
|
|
|
|
|
|
|
|
- name: Run Playwright test - 2/2
|
2023-05-22 11:10:08 +00:00
|
|
|
run: Xvfb :99 -screen 0 1024x768x16 & fluxbox & npx playwright test --reporter github --shard=2/2
|
2022-11-29 18:12:21 +00:00
|
|
|
env:
|
|
|
|
LOGSEQ_CI: true
|
|
|
|
DEBUG: "pw:api"
|
|
|
|
RELEASE: true # skip dev only test
|
2021-11-23 06:30:49 +00:00
|
|
|
|
2022-12-01 07:19:55 +00:00
|
|
|
- name: Save test artifacts
|
2022-01-13 03:57:51 +00:00
|
|
|
if: ${{ failure() }}
|
2022-11-30 05:23:06 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-11-23 06:30:49 +00:00
|
|
|
with:
|
2022-12-01 07:19:55 +00:00
|
|
|
name: e2e-test-report
|
2022-11-29 05:03:41 +00:00
|
|
|
path: e2e-dump/*
|
2022-11-30 11:29:18 +00:00
|
|
|
retention-days: 1
|