Skip to content

Commit

Permalink
chore: fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
darkbasic committed Sep 13, 2023
1 parent 1b29e27 commit 3153375
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 23,758 deletions.
74 changes: 34 additions & 40 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,89 +9,83 @@ on:
jobs:
test:
name: Test packages
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.0.1
- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
version: 6.22.2
node-version: 18.x
cache: 'yarn'

- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
cache: 'pnpm'
- name: Enable corepack
run: corepack enable

- name: Install Dependencies
run: pnpm install
run: yarn install

- name: Check lint
run: pnpm run test:lint
run: yarn run test:lint

- name: Compile packages
run: pnpm run compile
run: yarn run compile

- name: Docker compose
run: docker-compose up -d

- name: Run tests
run: pnpm run coverage
run: yarn run coverage

- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3

test-examples:
name: Test examples
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.0.1
- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
version: 6.22.2
node-version: 18.x
cache: 'yarn'

- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
cache: 'pnpm'
- name: Enable corepack
run: corepack enable

- name: Install Dependencies
run: pnpm install
run: yarn install

- name: Compile packages
run: pnpm run compile
run: yarn run compile

- name: Test examples
run: pnpm run test:examples
run: yarn run test:examples
env:
REACT_APP_API_URL: http://localhost:3000

test-documentation:
name: Test documentation
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2.0.1
- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
version: 6.22.2
node-version: 18.x
cache: 'yarn'

- name: Use Node.js 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
cache: 'pnpm'
- name: Enable corepack
run: corepack enable

- name: Install Dependencies
run: pnpm install
run: yarn install

- name: Test documentation
run: |
cd website
pnpm run generate-api-docs
pnpm run build
run: yarn workspace accounts-js run build
24 changes: 12 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js 14.x
- name: Set Node.js 18.x
uses: actions/setup-node@master
with:
node-version: 14.x
node-version: 18.x

- name: Cache .pnpm-store
uses: actions/cache@v1
- name: Cache .yarn
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node14-${{ hashFiles('**/pnpm-lock.yaml') }}
path: ~/.yarn
key: ${{ runner.os }}-node18-${{ hashFiles('**/yarn.lock') }}

- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.7.js | node - add --global pnpm@6
- name: Enable corepack
run: corepack enable

- name: Install Dependencies
run: pnpm install
run: yarn install

- name: Create Release Pull Request
uses: changesets/action@master
with:
version: pnpm run version
publish: pnpm run release
version: yarn run version
publish: yarn run release
commit: 'chore: update versions'
title: 'chore: version packages'
env:
Expand Down
4 changes: 2 additions & 2 deletions examples/accounts-microservice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Includes two examples of using `@accounts/boost`.

`pnpm run start:mono` - Starts a GraphQL server which consumes the `@accounts/boost` typeDefs and resolvers when building your app's schema.
`yarn run start:mono` - Starts a GraphQL server which consumes the `@accounts/boost` typeDefs and resolvers when building your app's schema.

`pnpm run start:micro` - Starts a `@accounts/boost` as a GraphQL microservice which is then stitched with your app's schema.
`yarn run start:micro` - Starts a `@accounts/boost` as a GraphQL microservice which is then stitched with your app's schema.
8 changes: 4 additions & 4 deletions examples/graphql-server-typeorm-postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ This example demonstrate how to use [accounts-js](https://github.com/accounts-js
In order to be able to run this example on your machine you first need to do the following steps:

- Clone the repository `git clone git@github.com:accounts-js/accounts.git`
- Install project dependencies: `pnpm install`
- Compile the packages `pnpm run compile`
- Install project dependencies: `yarn install`
- Compile the packages `yarn run compile`
- Go to the example folder `cd examples/graphql-server-typeorm-postgres`

## Prerequisites
Expand All @@ -22,7 +22,7 @@ docker-compose up -d
to start a new one.

If you have postgres already installed on your system, you can just edit the .env file and use your current postgres data instead of the supplied Docker image.
Alternatively you can simply prepend the `DATABASE_URL` and `ACCOUNTS_SECRET` environmental variables to your `pnpm run start` command.
Alternatively you can simply prepend the `DATABASE_URL` and `ACCOUNTS_SECRET` environmental variables to your `yarn run start` command.

## Getting Started

Expand All @@ -31,7 +31,7 @@ Start the app.
Visit <http://localhost:4000/>

```bash
pnpm run start
yarn run start
```

-> [Start the client side](../react-graphql-typescript).
Expand Down
6 changes: 3 additions & 3 deletions examples/graphql-server-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ This example demonstrate how to use [accounts-js](https://github.com/accounts-js
In order to be able to run this example on your machine you first need to do the following steps:

- Clone the repository `git clone git@github.com:accounts-js/accounts.git`
- Install project dependencies: `pnpm install`
- Compile the packages `pnpm run compile`
- Install project dependencies: `yarn install`
- Compile the packages `yarn run compile`
- Go to the example folder `cd examples/graphql-server-typescript`

## Prerequisites
Expand All @@ -28,7 +28,7 @@ Start the app.
Visit http://localhost:4000/

```bash
pnpm run start
yarn run start
```

-> [Start the client side](../react-graphql-typescript).
Expand Down
6 changes: 3 additions & 3 deletions examples/magic-link-server-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ This example demonstrate how to use setup [accounts-js](https://github.com/accou
In order to be able to run this example on your machine you first need to do the following steps:

- Clone the repository `git clone git@github.com:accounts-js/accounts.git`
- Install project dependencies: `pnpm install`
- Compile the packages `pnpm run compile`
- Install project dependencies: `yarn install`
- Compile the packages `yarn run compile`
- Go to the example folder `cd examples/magic-link-server-typescript`

## Prerequisites
Expand All @@ -29,7 +29,7 @@ for a more comprehensive example of general accounts use.
To run the example:

```bash
pnpm run start
yarn run start
```

You should see output on the console suggesting that authenticating using a token was
Expand Down
6 changes: 3 additions & 3 deletions examples/react-graphql-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ This example demonstrate how to use [accounts-js](https://github.com/accounts-js
In order to be able to run this example on your machine you first need to do the following steps:

- Clone the repository `git clone git@github.com:accounts-js/accounts.git`
- Install project dependencies: `pnpm install`
- Compile the packages `pnpm run compile`
- Install project dependencies: `yarn install`
- Compile the packages `yarn run compile`
- Go to the example folder `cd examples/react-graphql-typescript`

## Getting Started
Expand All @@ -18,7 +18,7 @@ If you haven't started the example server side, [go ahead to start it first](../
Start the app.

```bash
pnpm run start
yarn run start
```

Open a browser and navigate to [http://localhost:3000](http://localhost:3000).
6 changes: 3 additions & 3 deletions examples/react-rest-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ In order to get the example running you also need to start the [REST server](htt
In order to be able to run this example on your machine you first need to do the following steps:

- Clone the repository `git clone git@github.com:accounts-js/accounts.git`
- Install project dependencies: `pnpm install`
- Compile the packages `pnpm run compile`
- Install project dependencies: `yarn install`
- Compile the packages `yarn run compile`
- Go to the example folder `cd examples/react-rest-typescript`

## Getting Started

Start the app.

```
pnpm run start
yarn run start
```

Open a browser and navigate to [http://localhost:3000](http://localhost:3000).
6 changes: 3 additions & 3 deletions examples/rest-express-typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ You must have a mongodb server running before starting the server.
In order to be able to run this example on your machine you first need to do the following steps:

- Clone the repository `git clone git@github.com:accounts-js/accounts.git`
- Install project dependencies: `pnpm install`
- Compile the packages `pnpm run compile`
- Install project dependencies: `yarn install`
- Compile the packages `yarn run compile`
- Go to the example folder `cd examples/rest-express-typescript`

## Getting Started

Start the app.

```
pnpm run start
yarn run start
```

Open a browser and navigate to [http://localhost:4000](http://localhost:4000).
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[build]
base = "."
publish = "website/build"
command = "npx pnpm install --store=node_modules/.pnpm-store && cd website && npm run generate-api-docs && npm run build"
command = "yarn install && yarn workspace accounts-js run build"

[build.environment]
NODE_VERSION = "14"
NODE_VERSION = "18"
NPM_FLAGS = "--version"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"test:examples": "lerna run test --scope=\"@examples/*\"",
"coverage": "lerna run coverage",
"codecov": "codecov",
"version": "pnpx changeset version && yarn install --lockfile-only",
"release": "yarn run compile && pnpx changeset publish",
"version": "yarn changeset version && yarn install --immutable",
"release": "yarn run compile && yarn changeset publish",
"reset": "yarn run clean; yarn run install; yarn run compile",
"postinstall": "husky install"
},
Expand Down
Loading

0 comments on commit 3153375

Please sign in to comment.