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
53 changes: 37 additions & 16 deletions .github/workflows/integration-tests-V2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,43 @@ jobs:
with:
repository: Railgun-Privacy/contract
path: contract
- name: Enable Corepack
run: corepack enable
- name: Yarn in engine
uses: borales/actions-yarn@v4
with:
cmd: install
dir: 'engine'
working-directory: ./engine
run: yarn install --frozen-lockfile
- name: Yarn in contract
uses: borales/actions-yarn@v4
with:
cmd: install
dir: 'contract'
working-directory: ./contract
run: yarn install --frozen-lockfile
- name: Build contract
run: cd contract && npm run compile
- name: Run contract hardhat and engine tests
uses: BerniWittmann/background-server-action@v1
with:
command: cd contract && npm run deploy && cd ../engine && yarn test-hardhat-V2
start: cd contract && npm run node >/dev/null
wait-on: 'http://localhost:8545'
wait-on-timeout: 120
working-directory: ./contract
run: npm run compile
- name: Start Hardhat node (background)
working-directory: ./contract
run: |
npm run node > "$GITHUB_WORKSPACE/hardhat.log" 2>&1 &
echo $! > "$GITHUB_WORKSPACE/hardhat.pid"
for i in {1..120}; do
if curl -s -o /dev/null -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' \
http://localhost:8545; then
echo "Hardhat node ready"
exit 0
fi
sleep 1
done
echo "Hardhat node did not become ready in 120s"
cat "$GITHUB_WORKSPACE/hardhat.log"
exit 1
- name: Deploy contracts
working-directory: ./contract
run: npm run deploy
- name: Run engine tests
working-directory: ./engine
run: yarn test-hardhat-V2
- name: Stop Hardhat node
if: always()
run: |
if [ -f "$GITHUB_WORKSPACE/hardhat.pid" ]; then
kill "$(cat "$GITHUB_WORKSPACE/hardhat.pid")" 2>/dev/null || true
fi
53 changes: 37 additions & 16 deletions .github/workflows/integration-tests-V3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,43 @@ jobs:
with:
repository: Railgun-Privacy/contract
path: contract
- name: Enable Corepack
run: corepack enable
- name: Yarn in engine
uses: borales/actions-yarn@v4
with:
cmd: install
dir: 'engine'
working-directory: ./engine
run: yarn install --frozen-lockfile
- name: Yarn in contract
uses: borales/actions-yarn@v4
with:
cmd: install
dir: 'contract'
working-directory: ./contract
run: yarn install --frozen-lockfile
- name: Build contract
run: cd contract && ./node_modules/.bin/hardhat compile
- name: Run contract hardhat and engine tests
uses: BerniWittmann/background-server-action@v1
with:
command: cd engine && yarn test-hardhat
start: cd contract && npx hardhat node >/dev/null, cd contract && sleep 5 && npx hardhat deploy:test --network localhost >/dev/null
wait-on: 'http://localhost:8545'
wait-on-timeout: 120
working-directory: ./contract
run: ./node_modules/.bin/hardhat compile
- name: Start Hardhat node (background)
working-directory: ./contract
run: |
npx hardhat node > "$GITHUB_WORKSPACE/hardhat.log" 2>&1 &
echo $! > "$GITHUB_WORKSPACE/hardhat.pid"
for i in {1..120}; do
if curl -s -o /dev/null -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' \
http://localhost:8545; then
echo "Hardhat node ready"
exit 0
fi
sleep 1
done
echo "Hardhat node did not become ready in 120s"
cat "$GITHUB_WORKSPACE/hardhat.log"
exit 1
- name: Deploy test contracts
working-directory: ./contract
run: npx hardhat deploy:test --network localhost
- name: Run engine tests
working-directory: ./engine
run: yarn test-hardhat
- name: Stop Hardhat node
if: always()
run: |
if [ -f "$GITHUB_WORKSPACE/hardhat.pid" ]; then
kill "$(cat "$GITHUB_WORKSPACE/hardhat.pid")" 2>/dev/null || true
fi
7 changes: 3 additions & 4 deletions .github/workflows/publish-npmjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Install yarn
uses: borales/actions-yarn@v4
with:
cmd: install
cache: 'yarn'
- run: corepack enable
- run: yarn install --frozen-lockfile
- run: npm publish
6 changes: 2 additions & 4 deletions .github/workflows/unit-tests-V2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:
with:
node-version: '18'
cache: 'yarn'
- name: Install yarn
uses: borales/actions-yarn@v4
with:
cmd: install
- run: corepack enable
- run: yarn install --frozen-lockfile
- name: Yarn test
shell: bash
run: yarn test-V2
6 changes: 2 additions & 4 deletions .github/workflows/unit-tests-V3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:
with:
node-version: '18'
cache: 'yarn'
- name: Install yarn
uses: borales/actions-yarn@v4
with:
cmd: install
- run: corepack enable
- run: yarn install --frozen-lockfile
- name: Yarn test
shell: bash
run: yarn test
Loading