Skip to content
Latchkey

Test ASReview webapp workflow (asreview/asreview)

The Test ASReview webapp workflow from asreview/asreview, explained and optimized by Latchkey.

C

CI health: C - fair

Point runs-on at Latchkey and get run de-duplication, job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: asreview/asreview.github/workflows/ci-webapp.ymlLicense Apache-2.0View source

What it does

This is the Test ASReview webapp workflow from the asreview/asreview repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: Test ASReview webapp
on: [push, pull_request]
jobs:
  prettier:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v6
      - name: Set up Node.js
        uses: actions/setup-node@v6
        with:
          node-version: "20"
          cache: "npm"
          cache-dependency-path: "asreview/webapp/package-lock.json"
      - name: Install dependencies
        run: |
          cd asreview/webapp
          npm install
      - name: Run Prettier
        run: |
          cd asreview/webapp
          npm run format
  ruff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v5
        with:
          python-version: "3.13"
      - name: Install ruff
        run: |
          pip install .[dev]
      - name: Lint Python
        run: |
          ruff check asreview/webapp
  compile-and-test:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
          fetch-depth: 0
          fetch-tags: true
      - uses: actions/setup-python@v5
        with:
          python-version: "3.13"
      - uses: actions/setup-node@v6
        with:
          node-version: "20"
          cache: "npm"
          cache-dependency-path: "asreview/webapp/package-lock.json"
      - name: Install setuptools
        run: |
          pip install setuptools
      - name: Compile assets
        run: |
          python setup.py compile_assets
      - name: Install pytest and package
        run: |
          pip install pytest pytest-random-order pytest-xdist
          pip install --no-cache-dir .
      - name: Cache synergy dataset
        uses: actions/cache@v4
        with:
          path: ~/.synergy_dataset_source
          key: synergy-dataset-${{ runner.os }}-v1.0
      - name: Download synergy dataset
        run: |
          python -c "
          from synergy_dataset.base import _dataset_available, download_raw_dataset
          if not _dataset_available():
              try:
                  download_raw_dataset(source='dataverse')
              except Exception:
                  download_raw_dataset(source='github')
          print('Synergy dataset available:', _dataset_available())
          "
      - name: Test flask web app
        run: |
          pytest --random-order -n 6 asreview/webapp/tests

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: Test ASReview webapp
on: [push, pull_request]
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
jobs:
  prettier:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - name: Checkout code
        uses: actions/checkout@v6
      - name: Set up Node.js
        uses: actions/setup-node@v6
        with:
          node-version: "20"
          cache: "npm"
          cache-dependency-path: "asreview/webapp/package-lock.json"
      - name: Install dependencies
        run: |
          cd asreview/webapp
          npm install
      - name: Run Prettier
        run: |
          cd asreview/webapp
          npm run format
  ruff:
    timeout-minutes: 30
    runs-on: latchkey-small
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v5
        with:
          python-version: "3.13"
      - name: Install ruff
        run: |
          pip install .[dev]
      - name: Lint Python
        run: |
          ruff check asreview/webapp
  compile-and-test:
    timeout-minutes: 30
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
        with:
          submodules: recursive
          fetch-depth: 0
          fetch-tags: true
      - uses: actions/setup-python@v5
        with:
          python-version: "3.13"
      - uses: actions/setup-node@v6
        with:
          node-version: "20"
          cache: "npm"
          cache-dependency-path: "asreview/webapp/package-lock.json"
      - name: Install setuptools
        run: |
          pip install setuptools
      - name: Compile assets
        run: |
          python setup.py compile_assets
      - name: Install pytest and package
        run: |
          pip install pytest pytest-random-order pytest-xdist
          pip install --no-cache-dir .
      - name: Cache synergy dataset
        uses: actions/cache@v4
        with:
          path: ~/.synergy_dataset_source
          key: synergy-dataset-${{ runner.os }}-v1.0
      - name: Download synergy dataset
        run: |
          python -c "
          from synergy_dataset.base import _dataset_available, download_raw_dataset
          if not _dataset_available():
              try:
                  download_raw_dataset(source='dataverse')
              except Exception:
                  download_raw_dataset(source='github')
          print('Synergy dataset available:', _dataset_available())
          "
      - name: Test flask web app
        run: |
          pytest --random-order -n 6 asreview/webapp/tests
 

What changed

What Latchkey heals here

This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:

This workflow runs 3 jobs (4 with the matrix expanded) per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow