Skip to content

Commit

Permalink
Merge branch 'master' into SDK-1173-dfx-deploy-canister-create-create…
Browse files Browse the repository at this point in the history
…-new-canisters-using-the-principals-cycles
  • Loading branch information
sesi200 authored Dec 7, 2023
2 parents 2cfe147 + 826cf17 commit a6fb448
Show file tree
Hide file tree
Showing 11 changed files with 465 additions and 51 deletions.
42 changes: 41 additions & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,50 @@ jobs:
- name: Run e2e test
run: timeout 2400 bats "e2e/$E2E_TEST"

ui_test:
runs-on: ${{ matrix.os }}
needs: [build_dfx]
strategy:
matrix:
os: [macos-12, ubuntu-20.04, ubuntu-22.04]
steps:
- name: Checking out repo
uses: actions/checkout@v4
- name: Setting up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Installing playwright
run: |
pip install playwright==1.40.0
playwright install
playwright install-deps
- name: Download dfx binary
uses: actions/download-artifact@v3
with:
name: dfx-${{ matrix.os }}-rs-${{ hashFiles('rust-toolchain.toml') }}
path: /usr/local/bin
- name: Setup dfx binary
run: chmod +x /usr/local/bin/dfx
- name: Deploy default dfx project
run: |
dfx new e2e_project
cd e2e_project
dfx start --background --clean
dfx deploy 2>&1 | tee deploy.log
echo FRONTEND_URL=$(grep "_frontend:" deploy.log | grep -Eo "(http|https)://[a-zA-Z0-9./?=_&%:-]*") >> $GITHUB_ENV
echo CANDID_URL=$(grep "_backend:" deploy.log | grep -Eo "(http|https)://[a-zA-Z0-9./?=_&%:-]*") >> $GITHUB_ENV
- name: Running the Python script
run: |
python scripts/test-uis.py \
--frontend_url "$FRONTEND_URL" \
--candid_url "$CANDID_URL" \
--browser chromium firefox webkit
aggregate:
name: e2e:required
if: ${{ always() }}
needs: [test, smoke]
needs: [test, smoke, ui_test]
runs-on: ubuntu-latest
steps:
- name: check smoke test result
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/publish-dfxvm-install-script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish dfxvm install script

on:
push:
branches:
- sdk-1278-dfxvm-install-script
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# When getting Rust dependencies, retry on network error:
CARGO_NET_RETRY: 10
# Use the local .curlrc
CURL_HOME: .

jobs:
publish-manifest:
name: dfxvm-install-script-shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
- name: Generate
run: |
shellcheck --shell=sh public/install/*.sh --exclude SC2154,SC2034,SC3003,SC3014,SC3043
~/go/bin/shfmt -d -p -i 4 -ci -bn -s public/install/*.sh
sed -i "s/@revision@/${GITHUB_SHA}/" public/install/999_footer.sh
mkdir _out
cat public/install/*.sh > _out/install.sh
sed -i "
/#!.*/p
/##.*/p
/^ *$/d
/^ *#/d
s/ *#.*//
" _out/install.sh
- name: Upload Artifacts
if: github.event_name == 'push'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
single_commit: yes
branch: dfxvm-install-script
folder: _out/
3 changes: 3 additions & 0 deletions .github/workflows/publish-manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -17,6 +18,7 @@ env:

jobs:
publish-manifest:
name: install-script-shellcheck:required
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -38,6 +40,7 @@ jobs:
" _out/install.sh
cp public/manifest.json _out/manifest.json
- name: Upload Artifacts
if: github.event_name == 'push'
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
single_commit: yes
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

# UNRELEASED

### feat: `dfx ledger top-up` also accepts canister names

Previously, `dfx ledger top-up` only accepted canister principals. Now it accepts both principals and canister names.

### fix: installer once again detects if curl supports tlsv1.2

A change to `curl --help` output made it so the install script did not detect
that the `--proto` and `--tlsv1.2` options are available.

# 0.15.2

### fix: `dfx canister delete <canister id>` removes the related entry from the canister id store

Previously, deleting a canister in the project by id rather than by name
Expand Down
6 changes: 3 additions & 3 deletions docs/cli-reference/dfx-ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ dfx ledger top-up [options] canister [flag] --network ic

You can specify the following argument for the `dfx ledger top-up` command.

| Argument | Description |
|------------|------------------------------------------------------------------|
| `canister` | Specifies the canister identifier that you would like to top up. |
| Argument | Description |
|------------|--------------------------------------------------------------------------|
| `canister` | Specifies the canister identifier or name that you would like to top up. |

### Options

Expand Down
6 changes: 6 additions & 0 deletions e2e/tests-dfx/ledger.bash
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ tc_to_num() {
assert_contains "Using transfer at block height $block_height" "$stdout"
# shellcheck disable=SC2154
assert_contains "Canister was topped up with" "$stdout"

# Top up canister by name instead of principal
dfx_new
assert_command dfx canister create e2e_project_backend
assert_command dfx ledger top-up e2e_project_backend --amount 5
assert_contains "Canister was topped up with 617283500000000 cycles"
}

@test "ledger create-canister" {
Expand Down
2 changes: 1 addition & 1 deletion public/install/200_downloader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ check_help_for() {
fi

for _arg in "$@"; do
if ! "$_cmd" --help | grep -q -- "$_arg"; then
if ! "$_cmd" --help all | grep -q -- "$_arg"; then
_ok="n"
fi
done
Expand Down
5 changes: 3 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tags": {
"latest": "0.15.1"
"latest": "0.15.2"
},
"versions": [
"0.5.0",
Expand Down Expand Up @@ -59,6 +59,7 @@
"0.14.3",
"0.14.4",
"0.15.0",
"0.15.1"
"0.15.1",
"0.15.2"
]
}
Loading

0 comments on commit a6fb448

Please sign in to comment.