From bdccf92acdb973b99dd5b93f10e46d409bda70f9 Mon Sep 17 00:00:00 2001 From: GCHQDeveloper81 <175597767+GCHQDeveloper81@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:58:22 +0100 Subject: [PATCH] Update README and refactor github actions (#2) Add deploy step into GH actions and refactor --- .github/workflows/e2e.yml | 34 ----------- .github/workflows/test+deploy.yml | 98 ++++++++++++++++++++++++------- CONTRIBUTING.md | 2 +- README.md | 4 +- 4 files changed, 80 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/e2e.yml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index b54edb6..0000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,34 +0,0 @@ -# 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 diff --git a/.github/workflows/test+deploy.yml b/.github/workflows/test+deploy.yml index b68badc..978b37e 100644 --- a/.github/workflows/test+deploy.yml +++ b/.github/workflows/test+deploy.yml @@ -9,6 +9,9 @@ on: branches: ['main'] jobs: + # ********************** + # Build + # ********************** build: runs-on: ubuntu-latest steps: @@ -33,35 +36,90 @@ jobs: - name: Copyright check run: npm run copyright:check - - name: Linter + - name: Linting and Code Quality run: npm run lint - - name: Build app + - name: Build 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 + + # ********************** + # Unit + component tests + # ********************** + unit_and_component_tests: + name: 'Unit and component tests' + needs: 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: Component and Unit tests + run: npm run test:unit+component + + # ********************** + # End to end tests + # ********************** + e2e_tests: + runs-on: ubuntu-latest + needs: build + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + node-version: 20.15.1 + + - 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 + + # ********************** + # Deploy + # ********************** + + deploy: + needs: [build, e2e_tests, unit_and_component_tests] + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + + permissions: + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - uses: actions/download-artifact@v2 + with: + name: build + path: build + + - name: Deploy + id: deployment + uses: actions/deploy-pages@v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0f8bbb4..028bdd7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,7 +8,7 @@ Before making a new one, please search the existing issues to check if your chan ## Contributing code -We follow a branching strategy for handling contributions: +Prior to us accepting any work, you must sign the [GCHQ CLA Agreement](https://cla-assistant.io/gchq/ld-explorer). We follow a branching strategy for handling contributions: 1. Fork the Project 2. Create your Feature Branch (`git checkout -b feature/new_thing`) diff --git a/README.md b/README.md index 1531d79..a37de0c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Copyright 2024 [Crown Copyright](https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/) -LD-Explorer is the _missing tool_ for exploring and experimenting with linked data resources directly in the browser. +LD-Explorer is a prototype user interface built upon the [Comunica graph querying framework](https://comunica.dev/) that can be used for exploring linked data resources directly in the browser. We have found that this tool helps to better demonstrate the value and purpose of linked data to newcomers, and increases the speed at which experiments/ideas can be created and tested. We are open sourcing this software to fill what we believe is a software gap in the linked data linked data space and to hopefully encourage its growth into a valuable community tool. ## Development @@ -36,5 +36,3 @@ This software is inner-source and contributions are welcome. See [Contributing.m ## License 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