Add a script to develop against a local lexical project (#1076) #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [ main ] | |
| permissions: {} | |
| jobs: | |
| lint: | |
| permissions: | |
| contents: read | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 | |
| with: | |
| ruby-version: .ruby-version | |
| bundler-cache: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Install JavaScript dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Lint Ruby code for consistent style | |
| run: bin/rubocop -f github | |
| - name: Lint JavaScript code for consistent style and browser support | |
| run: yarn lint | |
| lint-actions: | |
| name: GitHub Actions audit | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Run actionlint | |
| uses: rhysd/actionlint@393031adb9afb225ee52ae2ccd7a5af5525e03e8 # v1.7.11 | |
| - name: Run zizmor | |
| uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 | |
| with: | |
| advanced-security: false | |
| js-unit-tests: | |
| name: JS unit tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Install JavaScript dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Run JavaScript tests | |
| run: yarn test | |
| rails-system-tests: | |
| name: Rails system tests | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: "Rails 8.1 (no adapter)" | |
| use_legacy_rails: "true" | |
| - name: "Rails main (with adapter)" | |
| use_legacy_rails: "" | |
| env: | |
| USE_RAILS_WITHOUT_ACTION_TEXT_ADAPTER: ${{ matrix.use_legacy_rails }} | |
| steps: | |
| - name: Install packages | |
| run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libyaml-dev pkg-config google-chrome-stable mupdf build-essential ffmpeg groff libreoffice-writer libreoffice-impress libreoffice-calc mupdf-tools libvips zip | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 | |
| with: | |
| ruby-version: .ruby-version | |
| bundler-cache: true | |
| cache-version: ${{ matrix.name }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Install JavaScript dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Build JavaScript assets | |
| run: yarn build | |
| - name: Run Rails tests | |
| env: | |
| RAILS_ENV: test | |
| run: | | |
| bin/rails db:test:prepare | |
| bin/rails test:all | |
| - name: Keep screenshots from failed system tests | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| if: failure() | |
| with: | |
| name: screenshots-${{ matrix.name }} | |
| path: ${{ github.workspace }}/test/dummy/tmp/screenshots | |
| if-no-files-found: ignore | |
| browser-test: | |
| name: Browser tests (${{ matrix.browser }}) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| browser: [chromium, firefox, webkit] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Node.js | |
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Install JavaScript dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Get Playwright version | |
| id: playwright-version | |
| run: echo "version=$(npx playwright --version)" >> "$GITHUB_OUTPUT" | |
| - name: Cache Playwright browsers | |
| id: playwright-cache | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ matrix.browser }}-${{ steps.playwright-version.outputs.version }} | |
| - name: Install Playwright browser | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: npx playwright install --with-deps ${{ matrix.browser }} | |
| - name: Install Playwright system deps | |
| if: steps.playwright-cache.outputs.cache-hit == 'true' | |
| run: npx playwright install-deps ${{ matrix.browser }} | |
| - name: Run Playwright tests | |
| run: yarn test:browser:${{ matrix.browser }} | |
| - name: Keep Playwright report | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| if: failure() | |
| with: | |
| name: playwright-report-${{ matrix.browser }} | |
| path: ${{ github.workspace }}/test/browser/playwright-report/ | |
| if-no-files-found: ignore |