Skip to content

Commit

Permalink
Set up Github actions (#1)
Browse files Browse the repository at this point in the history
* Set up Github Actions
* Add reporter for playwright
  • Loading branch information
GCHQDeveloper81 authored Jul 15, 2024
1 parent 60e0182 commit 4dfa8f9
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# https://playwright.dev/docs/ci-intro#setting-up-github-actions

name: End 2 End Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
timeout-minutes: 10
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm ci

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Run Playwright tests
run: npm run test:e2e -- --reporter=html

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
67 changes: 67 additions & 0 deletions .github/workflows/test+deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Install, test and Deploy LD Explorer

name: Test and Deploy

on:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v3
with:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node-version: 20.15.1
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Audit
run: npm audit --audit-level=critical

- name: Svelte-Check
run: npm run check

- name: Copyright check
run: npm run copyright:check

- name: Linter
run: npm run lint

- name: Build app
env:
BASE_PATH: '/${{ github.event.repository.name }}'
run: npm run build

- name: Component and Unit tests
run: npm run test:unit+component

- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: build
path: build
if-no-files-found: error
# deploy:
# needs: build
# runs-on: ubuntu-latest
# permissions:
# pages: write
# id-token: write
#
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
#
# steps:
# - name: Deploy
# id: deployment
# uses: actions/deploy-pages@v4
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@ This software is inner-source and contributions are welcome. See [Contributing.m
Unless stated otherwise, the codebase is released under the [Apache2 License](https://www.apache.org/licenses/LICENSE-2.0). This covers both the codebase and any sample code in the documentation. The documentation/wiki is and available under the terms of the [Open Government License v3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).

© Crown copyright 2024

0 comments on commit 4dfa8f9

Please sign in to comment.