Skip to content

Commit

Permalink
Merge branch 'master' into gabor/nat-shift
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreif authored Mar 6, 2024
2 parents ee79806 + 33f4321 commit fc7c84f
Show file tree
Hide file tree
Showing 56 changed files with 5,625 additions and 2,552 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ on:
# Remember to update me in package-set.yml as well
env:
vessel_version: "v0.7.0"
moc_version: "0.10.4"
moc_version: "0.11.0"

jobs:
tests:
if: github.ref != 'refs/heads/next-moc' && github.base_ref != 'refs/heads/next-moc'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/mops-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: publish on mops

on:
workflow_dispatch:
push:
tags:
- moc-*

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: ZenVoich/setup-mops@v1
with:
# Make sure you set the MOPS_IDENTITY_PEM secret in your repository settings https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository
identity-pem: ${{ secrets.MOPS_IDENTITY_PEM }}
- run: mops install
- run: mops publish
6 changes: 3 additions & 3 deletions .github/workflows/package-set.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ on:

env:
vessel_version: "v0.7.0"
moc_version: "0.10.4"
moc_version: "0.11.0"

jobs:
verify:
runs-on: ubuntu-22.04
steps:
- name: Checking out motoko-base
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
path: base-checkout
- name: Checking out vessel-package-set
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: dfinity/vessel-package-set
path: vessel-package-set
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
os: [ubuntu-22.04]
node: [18]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm install -g npm
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
sync-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Merge master -> next-moc
uses: devmasx/[email protected]
with:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## 0.10.3
* Added `ExperimentalInternetComputer.performanceCounter` function to get the raw performance counters (#600).

* Added `Array.take` function to get some prefix of an array (#587).

* Deprecated `TrieSet.mem` in favor of `TrieSet.contains` (#576).

* bugfix: `Array.chain(as, f)` was incorrectly trapping when `f(a)` was an empty array (#599).
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Usage
If you are installing Motoko through the DFINITY SDK releases, then this base
library is already included.

If you build your project using the [Mops package manager], run the following command to add the base package to your project:

```sh
mops add base
```

If you build your project using the [Vessel package manager] your package-set most likely already includes base, but if it doesn't or you want to override its version, add an entry like so to your `package-set.dhall`:

```
Expand All @@ -22,6 +28,8 @@ If you build your project using the [Vessel package manager] your package-set mo

The package _name_ `"base"` appears when importing its modules in Motoko (e.g., `import "mo:base/Nat"`). The _repo_ may either be your local clone path, or this public repository url, as above. The _version_ can be any git branch or tag name (such as `version = "moc-0.8.4"`). There are no dependencies. See the [Vessel package manager] docs for more details.

[Mops package manager]: https://mops.one

[Vessel package manager]: https://github.com/dfinity/vessel

Building & Testing
Expand All @@ -45,9 +53,15 @@ npm test -- --mode wasi
npm run prettier:format
```

The test runner will automatically detect the `moc` compiler from your system path or `dfx` installation.
**Note**:
- If you are using `npm test` to run the tests:
- You don't need to install any additional dependencies.
- The test runner will automatically download the `moc` and `wasmtime` versions specified in `mops.toml` in the `[toolchain]` section.

- If you are using `Makefile` to run the tests:
- The test runner will automatically detect the `moc` compiler from your system path or `dfx` installation.

Running the tests locally also requires [Wasmtime](https://wasmtime.dev/) and [Vessel](https://github.com/dfinity/vessel) to be installed on your system.
- Running the tests locally also requires [Wasmtime](https://wasmtime.dev/) and [Vessel](https://github.com/dfinity/vessel) to be installed on your system.

Run only specific test files:
```sh
Expand Down
15 changes: 13 additions & 2 deletions mops.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[package]
name = "base"
version = "0.11.0"
description = "The Motoko base library"
repository = "https://github.com/dfinity/motoko-base"
keywords = [ "base" ]
license = "Apache-2.0"

[dev-dependencies]
base = "./"
matchers = "https://github.com/kritzcreek/motoko-matchers#v1.3.0"
matchers = "https://github.com/kritzcreek/motoko-matchers#v1.3.0@3dac8a071b69e4e651b25a7d9683fe831eb7cffd"

[toolchain]
moc = "0.11.0"
wasmtime = "17.0.0"
Loading

0 comments on commit fc7c84f

Please sign in to comment.