Skip to content

Commit e0f6fe9

Browse files
slapec93Gergely Békési
andauthored
chore: remove axios (#1187)
* chore: remove axios * fix: response type in specs * fix: type check * fix: update ports * fix: method not allowed and more readable error msg * fix: streaming body * fix: satisfy test case * fix: failing specs * fix: more specs * fix: more * feat: simplify http implementation * fix: param striping * fix: export interface * chore: remove dependency * fix: lintcheck * fix: url construction * ci: add a workflow to test the lib with React Native * ci: temp set new workflow with push trigger * ci: generate token * ci: update workflow name * chore: update cafe-utility * ci: modify test workflow * ci: add new workflow steps * fix: revert project name and version change * ci: remove push trigger for rn test * fix: use nano second timestamp in stamper (#1186) * fix: use nano second timestamp in stamper * fix: update ports --------- Co-authored-by: Gergely Békési <gergely.bekesi@ethswarm.org> * fix: validate port in bee url (#1189) * fix: validate port in bee url * test: cover port validation with tests --------- Co-authored-by: Gergely Békési <gergely.bekesi@ethswarm.org> * ci: bump stable bee version (#1197) * ci: update stable tag * test: update test cases based on RC logic * test: update hash * test: update hashes 🤞 * fix: 😩 * fix: hash juggling --------- Co-authored-by: Gergely Békési <gergely.bekesi@ethswarm.org> * feat: add minimumValidityBlocks to chainstate response (#1194) * feat: add minimumValidityBlocks to chainstate response * test: cover with spec --------- Co-authored-by: Gergely Békési <gergely.bekesi@ethswarm.org> * feat: add postage batch label update endpoint (#1193) * feat: wip add stamp label update * test: finish spec * test: add specs for alias method * test: fix test cases --------- Co-authored-by: Gergely Békési <gergely.bekesi@ethswarm.org> --------- Co-authored-by: Gergely Békési <gergely.bekesi@ethswarm.org>
1 parent 00d21a6 commit e0f6fe9

12 files changed

Lines changed: 261 additions & 371 deletions

File tree

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Tests (React Native Android)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
tests-react-native-android:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Enable KVM
12+
run: |
13+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
14+
sudo udevadm control --reload-rules
15+
sudo udevadm trigger --name-match=kvm
16+
17+
- name: Checkout bee-js
18+
uses: actions/checkout@v6
19+
20+
- name: Set up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 24.x
24+
25+
- name: Install bee-js dependencies
26+
run: npm ci
27+
28+
- name: Pack bee-js
29+
run: echo "BEE_JS_PACK=$(npm pack --json | jq -r '.[0].filename')" >> $GITHUB_ENV
30+
31+
- name: Generate GitHub App token
32+
id: app-token
33+
uses: actions/create-github-app-token@v1
34+
with:
35+
app-id: ${{ secrets.BEE_RUNNER_APP_ID }}
36+
private-key: ${{ secrets.BEE_RUNNER_KEY }}
37+
repositories: bee-js-react-native-test
38+
39+
- name: Checkout bee-js-react-native-test
40+
uses: actions/checkout@v6
41+
with:
42+
repository: ethersphere/bee-js-react-native-test
43+
path: rn-test
44+
token: ${{ steps.app-token.outputs.token }}
45+
46+
- name: Install test project deps with local bee-js
47+
working-directory: rn-test
48+
# Drop the lockfile before installing the locally-packed bee-js so npm
49+
# resolves the full transitive tree from scratch. With `npm ci` + a
50+
# follow-up `npm install ../tgz`, npm dedupes against the already-pinned
51+
# transitives and can leave stale versions (e.g. cafe-utility 33.x)
52+
# even when the new bee-js declares a higher range.
53+
run: |
54+
rm -f package-lock.json
55+
npm install ../${{ env.BEE_JS_PACK }}
56+
57+
- name: Probe Metro resolution per-package (pre-flight)
58+
working-directory: rn-test
59+
# Sub-second per-package resolution check: for each bee-js transitive
60+
# asks Metro which file it would pick on Android, flags any landing on
61+
# `.mjs`, and requires each resolved file in Node. Cheap diagnostic
62+
# that prints a per-package pass/fail before the bundle probe runs.
63+
run: npm run test:probe-resolution
64+
65+
- name: Bundle bee-js with Metro and load it (fast pre-flight)
66+
working-directory: rn-test
67+
# ~1-second check that produces the actual Metro bundle bee-js would
68+
# ship to the device (Android conditions, Expo's resolver config), then
69+
# evaluates it in Node with RN-shaped globals. Catches packaging
70+
# regressions (broken exports map, CJS↔ESM interop bug, missing
71+
# transitive) before spending 10 min on Gradle + emulator. Misses
72+
# Hermes-specific behaviour and real bee-node interactions — those are
73+
# what the emulator job below is for.
74+
run: npm run test:probe
75+
76+
- name: Set up Java
77+
uses: actions/setup-java@v4
78+
with:
79+
distribution: temurin
80+
java-version: 17
81+
82+
- name: Cache Gradle
83+
uses: actions/cache@v4
84+
with:
85+
path: |
86+
~/.gradle/caches
87+
~/.gradle/wrapper
88+
key: gradle-${{ hashFiles('rn-test/android/**/*.gradle*', 'rn-test/android/gradle/wrapper/gradle-wrapper.properties') }}
89+
restore-keys: gradle-
90+
91+
- name: Install global dependencies
92+
run: npm install --global @ethersphere/bee-factory @ethersphere/swarm-cli npxie
93+
94+
- name: Start bee-factory
95+
run: bee-factory start --tag v2.8.0
96+
97+
- name: Create postage batch
98+
run: echo "STAMP=$(swarm-cli stamp buy --depth 20 --amount 1b --quiet)" >> $GITHUB_ENV
99+
100+
- name: Build APK
101+
working-directory: rn-test
102+
run: npm run test:build
103+
104+
- name: Run tests on emulator
105+
uses: reactivecircus/android-emulator-runner@v2
106+
with:
107+
api-level: 34
108+
arch: x86_64
109+
profile: pixel
110+
avd-name: Pixel_API_34
111+
force-avd-creation: false
112+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim
113+
disable-animations: true
114+
script: cd rn-test && npm run test:run

linkcheck.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const { default: axios } = require('axios')
21
const { Strings } = require('cafe-utility')
32
const { readdirSync, statSync, readFileSync } = require('fs')
43
const { join } = require('path')
@@ -29,7 +28,7 @@ function check(path) {
2928
})
3029
for (const link of links) {
3130
const cleanLink = link.replaceAll('](', '').replaceAll(')', '')
32-
axios.get(cleanLink).catch(error => {
31+
fetch(cleanLink).catch(error => {
3332
console.error(path, cleanLink, error.response.status)
3433
})
3534
}

0 commit comments

Comments
 (0)