Skip to content
Open
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
33 changes: 33 additions & 0 deletions .github/workflows/dispatch-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Dispatch release to create-swarm-app

on:
release:
types: [published]

jobs:
dispatch:
if: github.event.release.prerelease == false && github.event.release.draft == false
runs-on: ubuntu-latest

steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.BEE_RUNNER_CLIENT_ID }}
private-key: ${{ secrets.BEE_RUNNER_KEY }}
repositories: create-swarm-app

- name: Dispatch release event to create-swarm-app
uses: actions/github-script@v7
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
await github.rest.repos.createDispatchEvent({
owner: 'ethersphere',
repo: 'create-swarm-app',
event_type: 'bee-js-released',
client_payload: {
version: context.payload.release.tag_name.replace(/^v/, '')
}
})
10 changes: 5 additions & 5 deletions .github/workflows/tests-rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ jobs:

- name: Deposit to chequebook
run: |
swarm-cli cheque deposit 100000000000000000
swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:11633
swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:21633
swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:31633
swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:41633
swarm-cli cheque deposit 10
swarm-cli cheque deposit 10 --bee-api-url http://localhost:11633
swarm-cli cheque deposit 10 --bee-api-url http://localhost:21633
swarm-cli cheque deposit 10 --bee-api-url http://localhost:31633
swarm-cli cheque deposit 10 --bee-api-url http://localhost:41633

- name: Create managed postage batch
run: echo "JEST_MANAGED_BATCH_ID=$(swarm-cli stamp buy --depth 20 --amount 1b --quiet)" >> $GITHUB_ENV
Expand Down
45 changes: 36 additions & 9 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:

- name: Deposit to chequebook
run: |
swarm-cli cheque deposit 100000000000000000
swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:11633
swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:21633
swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:31633
swarm-cli cheque deposit 100000000000000000 --bee-api-url http://localhost:41633
swarm-cli cheque deposit 10
swarm-cli cheque deposit 10 --bee-api-url http://localhost:11633
swarm-cli cheque deposit 10 --bee-api-url http://localhost:21633
swarm-cli cheque deposit 10 --bee-api-url http://localhost:31633
swarm-cli cheque deposit 10 --bee-api-url http://localhost:41633

- name: Create managed postage batch
run: echo "JEST_MANAGED_BATCH_ID=$(swarm-cli stamp buy --depth 20 --amount 1b --quiet)" >> $GITHUB_ENV
Expand All @@ -59,11 +59,38 @@ jobs:
echo "exit_code=$?" >> $GITHUB_OUTPUT
set -e

- name: Compare coverage
- name: Upload coverage
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: coverage-master
path: test/coverage/coverage-summary.json

- name: Get master run ID
if: github.ref != 'refs/heads/master'
run:
npxie coverage-comparison "${{ github.repository }}" "master" "${{ github.head_ref }}"
"test/coverage/coverage-summary.json" "${{ github.event.pull_request.number }}" "${{ secrets.GITHUB_TOKEN }}"
id: get-run-id
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
run: |
RUN_ID=$(gh run list --branch master --workflow tests.yaml --limit 1 --json databaseId --jq '.[0].databaseId')
echo "run-id=$RUN_ID" >> $GITHUB_OUTPUT

- name: Download master coverage
if: github.ref != 'refs/heads/master'
id: download-coverage
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: coverage-master
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ steps.get-run-id.outputs.run-id }}
path: coverage-master

- name: Compare coverage
if: github.ref != 'refs/heads/master' && steps.download-coverage.outcome == 'success'
run: |
npxie coverage-comparison "${{ github.repository }}" "./coverage-master/coverage-summary.json" "test/coverage/coverage-summary.json" "${{ github.event.pull_request.number }}" "${{ secrets.GITHUB_TOKEN }}"

- name: Fail if tests failed
if: steps.tests.outputs.exit_code != '0'
Expand Down
Loading