Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PNW-2478 - delete workflow review #17

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 12 additions & 50 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Node CI

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]

Expand All @@ -28,73 +26,37 @@ jobs:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [18.x, 20.x]
fail-fast: true
if: ${{ needs.changes.outputs.cms == 'true' }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js {{ matrix.node-version }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
cache: 'npm'
- name: log versions
run: node --version && npm --version && yarn --version
- name: install dependecies
run: npm install
- name: install dependencies
run: npm ci
- name: run unit tests
run: npm run test:ci
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
- name: build demo site
run: npm run build:demo
- name: run e2e tests
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
run: npm run test:e2e:run-ci
env:
NODE_OPTIONS: --max-old-space-size=4096
- uses: actions/upload-artifact@master
with:
name: dev-test-website-${{ runner.os }}-${{ matrix.node-version }}
path: dev-test

e2e-with-cypress:
needs: [changes, build]
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
fail-fast: false

if: ${{ needs.changes.outputs.cms == 'true' }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- uses: actions/download-artifact@master
with:
name: dev-test-website-${{ runner.os }}-18.x
path: dev-test
- name: npm install
run: |
node --version
npm --version
yarn --version
npm install
- name: e2e test
run: |
npm run test:e2e:run-ci
env:
IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true || github.repository_owner != 'decaporg' }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
NODE_OPTIONS: --max-old-space-size=4096
MACHINE_COUNT: 2
MACHINE_INDEX: ${{ matrix.node-version }}
TZ: Europe/Amsterdam
- uses: actions/upload-artifact@v3
if: ${{ always() }}
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x' && failure()
with:
name: cypress-results-${{ matrix.node-version }}
name: cypress-results
path: |
cypress/screenshots
cypress/videos

2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const svgo = {
function presets() {
return [
'@babel/preset-react',
'@babel/preset-env',
['@babel/preset-env', isESM ? { modules: false } : {}],
[
'@emotion/babel-preset-css-prop',
{
Expand Down
42 changes: 21 additions & 21 deletions cypress/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@ import execa from 'execa';
import { globby } from 'globby';

async function runCypress() {
const args = ['run', '--browser', 'chrome', '--headless'];

const specs = await globby(['cypress/e2e/*spec*.js']);
if (specs.length === 0) {
console.log('No test files found in cypress/e2e/*spec*.js');
process.exit(1);
}

if (process.env.IS_FORK === 'true') {
const machineIndex = parseInt(process.env.MACHINE_INDEX);
const machineCount = parseInt(process.env.MACHINE_COUNT);
const specs = await globby(['cypress/integration/*spec*.js']);
const specsPerMachine = Math.floor(specs.length / machineCount);
const start = (machineIndex - 1) * specsPerMachine;
const machineSpecs =
machineIndex === machineCount
? specs.slice(start)
: specs.slice(start, start + specsPerMachine);

await execa(
'cypress',
['run', '--browser', 'chrome', '--headless', '--spec', machineSpecs.join(',')],
{ stdio: 'inherit', preferLocal: true },
);
args.push('--spec', machineSpecs.join(','));
} else {
await execa(
'cypress',
[
'run',
'--browser',
'chrome',
'--headless',
'--record',
'--parallel',
'--ci-build-id',
process.env.GITHUB_SHA,
'--group',
'GitHub CI',
],
{ stdio: 'inherit', preferLocal: true },
args.push(
'--record',
'--parallel',
'--ci-build-id',
process.env.GITHUB_SHA,
'--group',
'GitHub CI',
'--spec',
specs.join(','),
);
}

console.log('Running Cypress with args:', args.join(' '));
await execa('cypress', args, { stdio: 'inherit', preferLocal: true });
}

runCypress();
6 changes: 6 additions & 0 deletions cypress/support/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ addMatchImageSnapshotCommand({
Cypress.on('uncaught:exception', () => false);

import './commands';

afterEach(function () {
if (this.currentTest.state === 'failed') {
Cypress.runner.stop();
}
});
6 changes: 4 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"targetDefaults": {
"build:esm": {
"cache": true
"cache": true,
"dependsOn": ["^build:esm"]
},
"build": {
"cache": true
"cache": true,
"dependsOn": ["^build"]
}
},
"namedInputs": {
Expand Down
15 changes: 8 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build-preview": "npm run build && nx run decap-cms:build-preview --output-style=stream",
"type-check": "tsc --noEmit",
"type-check:watch": "npm run type-check -- --watch",
"clean": "rimraf \"packages/*/dist\" dev-test/dist \"packages/*/node_modules\"",
"clean": "rimraf \"packages/*/dist\" dev-test/dist \"packages/*/node_modules\" \".nx/cache\"",
"reset": "npm run clean",
"test": "npm run lint && npm run type-check && npm run test:unit",
"test:all": "npm run test && npm run test:e2e",
Expand Down
6 changes: 6 additions & 0 deletions packages/decap-cms-app/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [3.5.0](https://github.com/decaporg/decap-cms/compare/[email protected]@3.5.0) (2025-01-15)

### Bug Fixes

- **build:** Fix ESM output ([#7357](https://github.com/decaporg/decap-cms/issues/7357)) ([#7358](https://github.com/decaporg/decap-cms/issues/7358)) ([6cd7cb3](https://github.com/decaporg/decap-cms/commit/6cd7cb3b41718e20b44acaae1e2ffd73129520c2))

# [3.4.0](https://github.com/decaporg/decap-cms/compare/[email protected]@3.4.0) (2024-11-12)

**Note:** Version bump only for package decap-cms-app
Expand Down
8 changes: 5 additions & 3 deletions packages/decap-cms-app/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "decap-cms-app",
"description": "An extensible, open source, Git-based, React CMS for static sites. Reusable congiuration with React as peer.",
"version": "3.4.0",
"version": "3.5.0",
"homepage": "https://www.decapcms.org",
"repository": "https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-app",
"bugs": "https://github.com/decaporg/decap-cms/issues",
"module": "dist/esm/index.js",
"main": "dist/decap-cms-app.js",
"files": [
"src/",
Expand Down Expand Up @@ -34,6 +35,7 @@
"decap-cms-backend-azure": "^3.1.3",
"decap-cms-backend-bitbucket": "^3.1.4",
"decap-cms-backend-git-gateway": "^3.2.2",
"decap-cms-backend-gitea": "^3.1.5",
"decap-cms-backend-github": "^3.2.2",
"decap-cms-backend-gitlab": "^3.2.2",
"decap-cms-backend-proxy": "^3.1.4",
Expand All @@ -43,7 +45,7 @@
"decap-cms-lib-auth": "^3.0.5",
"decap-cms-lib-util": "^3.1.0",
"decap-cms-lib-widgets": "^3.1.0",
"decap-cms-locales": "^3.2.0",
"decap-cms-locales": "^3.3.0",
"decap-cms-ui-default": "^3.1.4",
"decap-cms-widget-boolean": "^3.1.3",
"decap-cms-widget-code": "^3.1.4",
Expand All @@ -55,7 +57,7 @@
"decap-cms-widget-map": "^3.1.4",
"decap-cms-widget-markdown": "^3.2.0",
"decap-cms-widget-number": "^3.1.3",
"decap-cms-widget-object": "^3.1.4",
"decap-cms-widget-object": "^3.2.0",
"decap-cms-widget-relation": "^3.3.2",
"decap-cms-widget-select": "^3.2.2",
"decap-cms-widget-string": "^3.1.3",
Expand Down
8 changes: 7 additions & 1 deletion packages/decap-cms-backend-git-gateway/src/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,13 @@
async entriesByFolder(folder: string, extension: string, depth: number, indexFile: string) {
return this.backend!.entriesByFolder(folder, extension, depth, indexFile);
}
allEntriesByFolder(folder: string, extension: string, depth: number, indexFile: string, pathRegex?: RegExp) {
allEntriesByFolder(
folder: string,
extension: string,
depth: number,
indexFile: string,
pathRegex?: RegExp,
) {
return this.backend!.allEntriesByFolder(folder, extension, depth, indexFile, pathRegex);
}
entriesByFiles(files: ImplementationFile[]) {
Expand Down Expand Up @@ -611,7 +617,7 @@
unpublishedEntries() {
return this.backend!.unpublishedEntries();
}
unpublishedEntry({ id, collection, slug }: { id?: string; collection?: string; slug?: string }) {

Check failure on line 620 in packages/decap-cms-backend-git-gateway/src/implementation.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18.x)

Property 'unpublishedEntry' in type 'GitGateway' is not assignable to the same property in base type 'Implementation'.

Check failure on line 620 in packages/decap-cms-backend-git-gateway/src/implementation.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20.x)

Property 'unpublishedEntry' in type 'GitGateway' is not assignable to the same property in base type 'Implementation'.

Check failure on line 620 in packages/decap-cms-backend-git-gateway/src/implementation.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 18.x)

Property 'unpublishedEntry' in type 'GitGateway' is not assignable to the same property in base type 'Implementation'.

Check failure on line 620 in packages/decap-cms-backend-git-gateway/src/implementation.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20.x)

Property 'unpublishedEntry' in type 'GitGateway' is not assignable to the same property in base type 'Implementation'.

Check failure on line 620 in packages/decap-cms-backend-git-gateway/src/implementation.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 20.x)

Property 'unpublishedEntry' in type 'GitGateway' is not assignable to the same property in base type 'Implementation'.

Check failure on line 620 in packages/decap-cms-backend-git-gateway/src/implementation.ts

View workflow job for this annotation

GitHub Actions / build (macos-latest, 20.x)

Property 'unpublishedEntry' in type 'GitGateway' is not assignable to the same property in base type 'Implementation'.

Check failure on line 620 in packages/decap-cms-backend-git-gateway/src/implementation.ts

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 18.x)

Property 'unpublishedEntry' in type 'GitGateway' is not assignable to the same property in base type 'Implementation'.
return this.backend!.unpublishedEntry({ id, collection, slug });
}
updateUnpublishedEntryStatus(collection: string, slug: string, newStatus: string) {
Expand Down
Loading
Loading