Skip to content

Commit

Permalink
test: fix tests & ci (#932)
Browse files Browse the repository at this point in the history
* chore: replace all uses of tx.balances.transfer() (#903)
* ci: run tests on prs to v0-lts
* ci: update actions (backport of #871)
* fix: update playwright dep
* fix: rename Docker image (#902)
* chore: pull image via ecr pull cache (#921)
---------
Co-authored-by: Andrés <[email protected]>
Co-authored-by: Antonio <[email protected]>
Co-authored-by: Gerawork Aynekulu <[email protected]>
  • Loading branch information
rflechtner authored Jan 16, 2025
1 parent 1881c44 commit fd3c7df
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cached-image-pull/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
- name: check image cache
id: image-cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.image-file.outputs.path }}
key: image-cache-${{ inputs.image }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/devpackpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
runs-on: ubuntu-latest
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && github.repository == 'kiltprotocol/sdk-js'"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# fetch-depth 0 and token needed to push changes on the package.json files back.
fetch-depth: 0
token: ${{ secrets.REPO_ACCESS_TOKEN }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install and Build
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/npmpublish-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -19,8 +19,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -32,7 +32,7 @@ jobs:
run: yarn run bundle
- name: Get current package version
id: package_version
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Publish to NPM
run: yarn run publish --tag rc
env:
Expand All @@ -43,4 +43,4 @@ jobs:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: KILTProtocol/docs
event-type: sdk-update
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
12 changes: 6 additions & 6 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -19,8 +19,8 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -32,7 +32,7 @@ jobs:
run: yarn run bundle
- name: Get current package version
id: package_version
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
run: echo "package_version=$(node -pe "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Publish to NPM
run: yarn run publish --tag latest
env:
Expand All @@ -43,4 +43,4 @@ jobs:
token: ${{ secrets.REPO_ACCESS_TOKEN }}
repository: KILTProtocol/docs
event-type: sdk-update
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
client-payload: '{"latestTag": "${{ steps.package_version.outputs.package_version }}"}'
39 changes: 19 additions & 20 deletions .github/workflows/test-node-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@ on:
inputs:
docker-image-tag-name:
type: string
description: The tag of the kiltprotocol/prototype-chain Docker image to test against
description: The tag of the kiltprotocol/standalone-node Docker image to test against
required: true

env:
TESTCONTAINERS_WATCHER_IMG: testcontainers/ryuk:0.3.2

jobs:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
Expand All @@ -30,7 +29,7 @@ jobs:
- name: zip build
run: zip -r build.zip .
- name: upload build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
path: build.zip
Expand All @@ -39,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: make sure testcontainers image is in cache
uses: ./.github/actions/cached-image-pull
with:
Expand All @@ -51,33 +50,33 @@ jobs:
needs: cache_imgs

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build
- name: unzip
run: unzip build.zip -d .
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Log out node version
run: node --version

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2

- name: pull image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: kilt/prototype-chain
ECR_REPOSITORY: dh/kiltprotocol/standalone-node
IMAGE_TAG: ${{ github.event.inputs.docker-image-tag-name }}
run: |
docker pull $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
Expand All @@ -97,19 +96,19 @@ jobs:
needs: build

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build
- name: unzip
run: unzip build.zip -d .
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: yarn bundle
run: yarn bundle
- name: upload bundle artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: checked-nonmin-bundle
path: packages/sdk-js/dist/sdk-js.umd.js
Expand All @@ -120,33 +119,33 @@ jobs:
needs: [cache_imgs, bundle_cache]

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build
- name: unzip
run: unzip build.zip -d .
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: checked-nonmin-bundle
path: packages/sdk-js/dist
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- run: basename /packages/sdk-js/dist/
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2
- name: pull node image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: kilt/prototype-chain
ECR_REPOSITORY: dh/kiltprotocol/standalone-node
IMAGE_TAG: ${{ github.event.inputs.docker-image-tag-name }}
run: |
docker pull $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/tests-polkadot-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: master
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
Expand All @@ -35,7 +35,7 @@ jobs:
- name: list dependencies
run: echo "$(yarn info -A --name-only --json)" > locked_dependencies.txt
- name: upload dependencies list
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: deps-${{ matrix.node-version }}
path: |
Expand All @@ -47,7 +47,7 @@ jobs:
- name: zip build
run: zip -r build.zip .
- name: upload build
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.node-version }}
path: build.zip
Expand All @@ -63,11 +63,13 @@ jobs:
include:
- node-version: 20.x
required: 'optional'
- node-version: 22.x
required: 'optional'

continue-on-error: ${{ matrix.required == 'optional' }}

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.node-version }}
- name: unzip
Expand All @@ -91,7 +93,7 @@ jobs:
continue-on-error: ${{ matrix.required == 'optional' }}

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build-16.x
- name: unzip
Expand All @@ -106,12 +108,12 @@ jobs:

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
uses: aws-actions/amazon-ecr-login@v2

- name: pull image
- name: pull node image
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: kilt/prototype-chain
ECR_REPOSITORY: dh/kiltprotocol/standalone-node
IMAGE_TAG: ${{ matrix.image }}
run: |
docker pull $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
Expand All @@ -135,7 +137,7 @@ jobs:
needs: [test, integration_test]
if: failure()
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: deps-16.x
- name: set dependencies env
Expand Down
Loading

0 comments on commit fd3c7df

Please sign in to comment.