diff --git a/.github/workflows/deploy-webui.yml b/.github/workflows/deploy-webui.yml index 6a30e79d49..c6d373d65d 100644 --- a/.github/workflows/deploy-webui.yml +++ b/.github/workflows/deploy-webui.yml @@ -1,11 +1,11 @@ -name: Deploy webui to Github Pages +name: deploy Capa Explorer Web to Github Pages on: # Runs on pushes targeting the webui branch push: branches: [ master ] - pull_request: - branches: [ master ] + paths: + - 'web/explorer/**' # Allows to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/web-tests.yml b/.github/workflows/web-tests.yml new file mode 100644 index 0000000000..2fcd8f30c7 --- /dev/null +++ b/.github/workflows/web-tests.yml @@ -0,0 +1,42 @@ +name: Capa Explorer Web tests + +on: + pull_request: + branches: [ master ] + paths: + - 'web/explorer/**' + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: 'recursive' + fetch-depth: 1 + show-progress: true + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'npm' + cache-dependency-path: './web/explorer/package-lock.json' + + - name: Install dependencies + run: npm ci + working-directory: ./web/explorer + + - name: Lint + run: npm run lint + working-directory: ./web/explorer + + - name: Format + run: npm run format + working-directory: ./web/explorer + + - name: Run unit tests + run: npm run test + working-directory: ./web/explorer