Skip to content

Commit

Permalink
chore: fix CODEOWNERS and workflow for canister-logs example (#872)
Browse files Browse the repository at this point in the history
  • Loading branch information
maksymar authored May 23, 2024
1 parent 85cd3a6 commit 3cdf010
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/motoko/basic_bitcoin/ @dfinity/execution
/motoko/basic_dao/ @dfinity/languages
/motoko/calc/ @dfinity/languages
/motoko/canister_logs/ @dfinity/execution
/motoko/cert-var/ @dfinity/trust
/motoko/classes/ @dfinity/languages
/motoko/composite_query/ @dfinity/languages
Expand Down Expand Up @@ -54,6 +55,7 @@

/rust/basic_bitcoin/ @dfinity/execution
/rust/basic_dao/ @dfinity/testing-verification
/rust/canister_logs/ @dfinity/execution
/rust/canister-info/ @dfinity/testing-verification
/rust/composite_query/ @dfinity/execution
/rust/counter/ @dfinity/growth
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/motoko-canister-logs-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: motoko-canister-logs
on:
push:
branches:
- master
pull_request:
paths:
- motoko/canister_logs/**
- .github/workflows/provision-darwin.sh
- .github/workflows/provision-linux.sh
- .github/workflows/motoko-canister-logs-example.yaml
- .ic-commit
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
motoko-canister-logs-example-darwin:
runs-on: macos-12
steps:
- uses: actions/checkout@v1
- name: Provision Darwin
run: bash .github/workflows/provision-darwin.sh
- name: Motoko Canister Logs Darwin
run: |
dfx start --background
pushd motoko/canister_logs
make test
popd
motoko-canister-logs-example-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Provision Linux
run: bash .github/workflows/provision-linux.sh
- name: Motoko Canister Logs Linux
run: |
dfx start --background
pushd motoko/canister_logs
make test
popd
40 changes: 40 additions & 0 deletions .github/workflows/rust-canister-logs-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: rust-canister-logs
on:
push:
branches:
- master
pull_request:
paths:
- rust/canister_logs/**
- .github/workflows/provision-darwin.sh
- .github/workflows/provision-linux.sh
- .github/workflows/rust-canister-logs-example.yaml
- .ic-commit
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
rust-canister-logs-example-darwin:
runs-on: macos-12
steps:
- uses: actions/checkout@v1
- name: Provision Darwin
run: bash .github/workflows/provision-darwin.sh
- name: Rust Canister Logs Darwin
run: |
dfx start --background
pushd rust/canister_logs
make test
popd
rust-canister-logs-example-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
- name: Provision Linux
run: bash .github/workflows/provision-linux.sh
- name: Rust Canister Logs Linux
run: |
dfx start --background
pushd rust/canister_logs
make test
popd
30 changes: 30 additions & 0 deletions motoko/canister_logs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.PHONY: all
all: build

.PHONY: build
.SILENT: build
build:
dfx canister create CanisterLogs
dfx build

.PHONY: install
.SILENT: install
install: build
dfx canister install CanisterLogs

.PHONY: upgrade
.SILENT: upgrade
upgrade: build
dfx canister install CanisterLogs --mode=upgrade

.PHONY: test
.SILENT: test
test: install
dfx canister call CanisterLogs print 'hi'
dfx canister logs CanisterLogs \
| grep 'hi' && echo 'PASS'

.PHONY: clean
.SILENT: clean
clean:
rm -fr .dfx
1 change: 1 addition & 0 deletions motoko/canister_logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ keywords: [beginner, motoko, canister logs, logging]
## Prerequisites
This example requires an installation of:

- [x] DFX version 0.19.0 or newer
- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/).
- [x] Download the following project files from GitHub: `git clone https://github.com/dfinity/examples/`

Expand Down
30 changes: 30 additions & 0 deletions rust/canister_logs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.PHONY: all
all: build

.PHONY: build
.SILENT: build
build:
dfx canister create canister_logs
dfx build

.PHONY: install
.SILENT: install
install: build
dfx canister install canister_logs

.PHONY: upgrade
.SILENT: upgrade
upgrade: build
dfx canister install canister_logs --mode=upgrade

.PHONY: test
.SILENT: test
test: install
dfx canister call canister_logs print 'hi'
dfx canister logs canister_logs \
| grep 'hi' && echo 'PASS'

.PHONY: clean
.SILENT: clean
clean:
rm -fr .dfx
1 change: 1 addition & 0 deletions rust/canister_logs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ keywords: [beginner, rust, canister logs, logging]
## Prerequisites
This example requires an installation of:

- [x] DFX version 0.19.0 or newer
- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/).
- [x] Download the following project files from GitHub: `git clone https://github.com/dfinity/examples/`

Expand Down

0 comments on commit 3cdf010

Please sign in to comment.