Skip to content

Commit

Permalink
build: fix windows build, build on multiple os using node 12 only (#3449
Browse files Browse the repository at this point in the history
)
  • Loading branch information
erezrokah committed Mar 23, 2020
1 parent ce69fdd commit 228c6b4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 33 deletions.
44 changes: 20 additions & 24 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ on:

jobs:
build:
runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [10.x, 12.x]
os: [macos-latest, windows-latest, ubuntu-latest]
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand All @@ -36,9 +36,6 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: |
${{ runner.os }}-yarn-
- name: update yarn to latest version
run: |
sudo apt update && sudo apt install yarn
- name: npm install, unit test and build
run: |
node --version
Expand All @@ -53,25 +50,26 @@ jobs:
NODE_OPTIONS: --max-old-space-size=4096
- uses: actions/upload-artifact@master
with:
name: dev-test-website-node-${{ matrix.node-version }}
name: dev-test-website-${{ runner.os }}-node-${{ matrix.node-version }}
path: dev-test

# non forked workflow (has access to build secrets)
e2e-with-cypress-record:
needs: build
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false)
runs-on: ubuntu-16.04
runs-on: ubuntu-latest

strategy:
matrix:
machine: [1, 2, 3, 4, 5, 6, 7, 8]
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 10.x
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v1
with:
path: ~/.cache/yarn
Expand All @@ -80,11 +78,8 @@ jobs:
${{ runner.os }}-yarn-
- uses: actions/download-artifact@master
with:
name: dev-test-website-node-10.x
name: dev-test-website-${{ runner.os }}-node-${{ matrix.node-version }}
path: dev-test
- name: update yarn to latest version
run: |
sudo apt update && sudo apt install yarn
- name: npm install and e2e test
run: |
node --version
Expand All @@ -101,14 +96,18 @@ jobs:
e2e-no-cypress-record:
needs: build
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true
runs-on: ubuntu-16.04
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js 10.x
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: 10.x
node-version: ${{ matrix.node-version }}
- uses: actions/cache@v1
with:
path: ~/.cache/yarn
Expand All @@ -117,11 +116,8 @@ jobs:
${{ runner.os }}-yarn-
- uses: actions/download-artifact@master
with:
name: dev-test-website-node-10.x
name: dev-test-website-${{ runner.os }}-node-${{ matrix.node-version }}
path: dev-test
- name: update yarn to latest version
run: |
sudo apt update && sudo apt install yarn
- name: npm install and e2e test
run: |
node --version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
node-version: [12.x]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand Down
17 changes: 10 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ For details on contributing to documentation, see [Website Directory Readme](htt

## Setup

> Install Node.js (LTS) on your system: [https://nodejs.org/](https://nodejs.org/)
> Install yarn on your system: [https://yarnpkg.com/en/docs/install](https://yarnpkg.com/en/docs/install)
### Install dependencies

> Only required on the first run, subsequent runs can use `yarn start` to both
bootstrap and run the development server.
> bootstrap and run the development server.
```sh
$ git clone https://github.com/netlify/netlify-cms
Expand Down Expand Up @@ -44,6 +46,7 @@ Watches all CMS packages and transpiles them on change.
```sh
yarn watch
```

### start

Starts the development server. This task runs both the `bootstrap` and `watch` scripts.
Expand Down Expand Up @@ -134,12 +137,12 @@ Netlify CMS uses the [Forking Workflow](https://www.atlassian.com/git/tutorials/

1. Fork the repo.
2. Create a branch from `master`. If you're addressing a specific issue, prefix your branch name with the issue number.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Run `yarn test` and ensure the test suite passes.
5. Use `yarn format` to format and lint your code.
6. PR's must be rebased before merge (feel free to ask for help).
7. PR should be reviewed by two maintainers prior to merging.
3. If you've added code that should be tested, add tests.
4. If you've changed APIs, update the documentation.
5. Run `yarn test` and ensure the test suite passes.
6. Use `yarn format` to format and lint your code.
7. PR's must be rebased before merge (feel free to ask for help).
8. PR should be reviewed by two maintainers prior to merging.

## License

Expand Down
2 changes: 1 addition & 1 deletion scripts/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const pkg = require(path.join(process.cwd(), 'package.json'));

const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';
const moduleNameToPath = libName => `${path.resolve(__dirname, `../node_modules/${libName}`)}/`;
const moduleNameToPath = libName => path.resolve(__dirname, '..', 'node_modules', libName);

const rules = () => ({
js: () => ({
Expand Down

0 comments on commit 228c6b4

Please sign in to comment.