Skip to content
Merged
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
39 changes: 7 additions & 32 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,17 @@ jobs:
check:
runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Checkout
uses: actions/checkout@v6

## Try getting the node modules from cache, if failed npm ci
- uses: actions/cache@v2
id: cache-npm
- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-${{ env.cache-name }}-
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install npm deps
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci
node-version: 24.x

- name: Commit linting
uses: wagoid/commitlint-github-action@v2
- name: Install local dependencies
run: npm ci

- name: Code linting
run: npm run lint:check
Expand All @@ -52,10 +34,3 @@ jobs:

- name: Check typings
run: npm run check:types

- name: Update supported Bee action
uses: ethersphere/update-supported-bee-action@v1
if: github.ref == 'refs/heads/master'
with:
token: ${{ secrets.REPO_GHA_PAT }}
updateEngine: 'true'
48 changes: 11 additions & 37 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,49 +15,23 @@ jobs:
nodejs:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x, 16.x, 17.x]

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
uses: actions/checkout@v6

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Auth to Github Package Docker Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
## Try getting the node modules from cache, if failed npm ci
- uses: actions/cache@v2
id: cache-npm
- name: Set up Node.js
uses: actions/setup-node@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-${{ matrix.node }}-${{ env.cache-name }}-
${{ runner.OS }}-node-${{ matrix.node }}-
- name: Install npm deps
if: steps.cache-npm.outputs.cache-hit != 'true'
node-version: 24.x

- name: Install local dependencies
run: npm ci

# Start Bee Factory environment
- name: Start Bee Factory environment
run: npm run bee -- --detach
- name: Install global dependencies
run: npm install --global @fairdatasociety/fdp-play

- name: Start fdp-play environment
run: fdp-play start --detach --fresh --bee-version d0aa8b9-commit

- name: Run unit and integration tests for node
run: npm run test -- --detectOpenHandles

- name: Debug workflow if failed
if: failure()
run: |
KEYS=$(curl -sSf -X POST https://relay.tunshell.com/api/sessions)
curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**Bee JS**\nDebug -> \`sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} relay.tunshell.com\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.WEBHOOK_KEY }}
echo "Connect to github actions node using"
echo "sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} relay.tunshell.com"
curl -sSf https://lets.tunshell.com/init.sh | sh /dev/stdin T $(echo $KEYS | jq -r .peer1_key) ${{ secrets.TUNSHELL_SECRET }} relay.tunshell.com
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ npm run start

```sh
export POSTAGE_DEPTH=20
export POSTAGE_AMOUNT=414720000
export POSTAGE_AMOUNT=414720001
export POSTAGE_TTL_MIN=60

npm run start
Expand All @@ -106,7 +106,7 @@ npm run start
export POSTAGE_EXTENDSTTL=true
export POSTAGE_TTL_MIN=60
export POSTAGE_DEPTH=20
export POSTAGE_AMOUNT=414720000
export POSTAGE_AMOUNT=414720001

npm run start
```
Expand Down
2 changes: 1 addition & 1 deletion dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ services:
- PORT=4000
- BEE_API_URL=http://swarm-test-queen:1633 # http://bee:1633 for bee dev
- POSTAGE_DEPTH=19
- POSTAGE_AMOUNT=414720000
- POSTAGE_AMOUNT=414720001
- POSTAGE_USAGE_THRESHOLD=0.49
- POSTAGE_USAGE_MAX=0.74
- POSTAGE_TTL_MIN=-2 # this is a hack to work with bee dev and bee-factory, see https://github.com/ethersphere/bee-factory/issues/74
Expand Down
8 changes: 2 additions & 6 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/en/configuration.html
*/
import type { Config } from '@jest/types'
import { JestConfigWithTsJest } from 'ts-jest'

export default async (): Promise<Config.InitialOptions> => {
export default async (): Promise<JestConfigWithTsJest> => {
return {
preset: 'ts-jest',
testEnvironment: 'node',
Expand All @@ -29,9 +29,5 @@ export default async (): Promise<Config.InitialOptions> => {

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: ['/node_modules/'],

moduleNameMapper: {
axios: 'axios/dist/node/axios.cjs',
},
}
}
Loading
Loading