Skip to content

Commit

Permalink
Merge pull request #958 from Royal-Navy/feat/pnpm
Browse files Browse the repository at this point in the history
build(Dependencies): Migrate from yarn to pnpm
  • Loading branch information
m7kvqbe1 authored May 14, 2024
2 parents f3e5dca + e003d5c commit a0a775a
Show file tree
Hide file tree
Showing 25 changed files with 21,641 additions and 18,764 deletions.
10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,5 @@ assignees: ''

Please provide a reference to a repository that includes a minimal reproduction of the issue.

We recommend spawning a new application using the [Royal Navy CRA Template](https://www.npmjs.com/package/cra-template-royalnavy):

```bash
// npx
npx create-react-app my-app --template royalnavy

// yarn create
yarn create react-app my-app --template royalnavy
```

### Screenshot
*Add a screenshot*
31 changes: 31 additions & 0 deletions .github/actions/prepare-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Set up Node.js and install dependencies
description: Sets up Node.js and installs dependencies
inputs:
unpack-prebuilt-libraries:
description: Whether to unpack pre-built icon-library and design-tokens bundles
required: false
default: ''
runs:
using: composite
steps:
- uses: pnpm/action-setup@v3
with:
version: 9.1.1
run_install: false
standalone: true

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

- name: Cache Node modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: node-modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install dependencies
shell: bash
run: |
pnpm install --frozen-lockfile --ignore-scripts
89 changes: 43 additions & 46 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,56 @@ on:

jobs:
Test_docs-site:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Git clone repository
uses: actions/checkout@v3
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Git clone repository
uses: actions/checkout@v4

- name: Cache Node modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Set up environment
uses: ./.github/actions/prepare-environment

- name: Build site
env:
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE_ID }}
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }}
run: |
yarn build
- name: Build site
env:
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE_ID }}
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }}
run: |
pnpm run build
- name: Jest
env:
JEST_JUNIT_OUTPUT_DIR: test-results/jest
JEST_JUNIT_OUTPUT_NAME: docs-site-results.xml
run: |
yarn test --ci --coverage --silent --no-cache --reporters=default --reporters=jest-junit --runInBand --testResultsProcessor=jest-sonar-reporter
- name: Jest
env:
JEST_JUNIT_OUTPUT_DIR: test-results/jest
JEST_JUNIT_OUTPUT_NAME: docs-site-results.xml
run: |
pnpm run test --ci --coverage --silent --no-cache --reporters=default --reporters=jest-junit --runInBand --testResultsProcessor=jest-sonar-reporter
- name: SonarCloud Scan
uses: defencedigital/design-system-sonarcloud-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: SonarCloud Scan
uses: defencedigital/design-system-sonarcloud-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Test-e2e_docs-site:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE_ID }}
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }}
steps:
- name: Git clone repository
uses: actions/checkout@v3
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
env:
NEXT_PUBLIC_CONTENTFUL_SPACE_ID: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_SPACE_ID }}
NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN: ${{ secrets.NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN }}
steps:
- name: Git clone repository
uses: actions/checkout@v4

- name: Run e2e tests
uses: cypress-io/github-action@v5
with:
build: yarn build
start: yarn start
- name: Run e2e tests
uses: cypress-io/github-action@v6
with:
build: pnpm run build
start: pnpm start

- name: Save images for failed tests
if: failure()
uses: actions/upload-artifact@v3
with:
name: cypress_screenshots
path: cypress/screenshots/
- name: Save images for failed tests
if: failure()
uses: actions/upload-artifact@v4
with:
name: cypress_screenshots
path: cypress/screenshots/
Automerge:
name: Merge Dependabot PR's
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/branch_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
PREVIEW_URL: https://deploy-preview--peaceful-wiles-97aae8.netlify.app
steps:
- name: Git clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Fetch all commits
run: git fetch --all
Expand Down
Loading

0 comments on commit a0a775a

Please sign in to comment.