Skip to content

Commit

Permalink
Add 'wash/' from commit '45a494d27b0c44c4fd2c1bb67ae7a2f63c924294'
Browse files Browse the repository at this point in the history
git-subtree-dir: wash
git-subtree-mainline: b07302f
git-subtree-split: 45a494d
Signed-off-by: Connor Smith <connor.smith.256@gmail.com>
  • Loading branch information
connorsmith256 committed Oct 17, 2023
2 parents b07302f + 45a494d commit 39281b3
Show file tree
Hide file tree
Showing 248 changed files with 43,890 additions and 0 deletions.
101 changes: 101 additions & 0 deletions wash/.config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
[store]
# The directory under the workspace root at which nextest-related files are
# written. Profile-specific storage is currently written to dir/<profile-name>.
dir = "target/nextest"

# This section defines the default nextest profile. Custom profiles are layered
# on top of the default profile.
[profile.default]
# "retries" defines the number of times a test should be retried. If set to a
# non-zero value, tests that succeed on a subsequent attempt will be marked as
# non-flaky. Can be overridden through the `--retries` option.
# Examples
# * retries = 3
# * retries = { backoff = "fixed", count = 2, delay = "1s" }
# * retries = { backoff = "exponential", count = 10, delay = "1s", jitter = true, max-delay = "10s" }
retries = 0

# The number of threads to run tests with. Supported values are either an integer or
# the string "num-cpus". Can be overridden through the `--test-threads` option.
test-threads = "num-cpus"

# The number of threads required for each test. This is generally used in overrides to
# mark certain tests as heavier than others. However, it can also be set as a global parameter.
threads-required = 1

# Show these test statuses in the output.
#
# The possible values this can take are:
# * none: no output
# * fail: show failed (including exec-failed) tests
# * retry: show flaky and retried tests
# * slow: show slow tests
# * pass: show passed tests
# * skip: show skipped tests (most useful for CI)
# * all: all of the above
#
# Each value includes all the values above it; for example, "slow" includes
# failed and retried tests.
#
# Can be overridden through the `--status-level` flag.
status-level = "pass"

# Similar to status-level, show these test statuses at the end of the run.
final-status-level = "flaky"

# "failure-output" defines when standard output and standard error for failing tests are produced.
# Accepted values are
# * "immediate": output failures as soon as they happen
# * "final": output failures at the end of the test run
# * "immediate-final": output failures as soon as they happen and at the end of
# the test run; combination of "immediate" and "final"
# * "never": don't output failures at all
#
# For large test suites and CI it is generally useful to use "immediate-final".
#
# Can be overridden through the `--failure-output` option.
failure-output = "immediate"

# "success-output" controls production of standard output and standard error on success. This should
# generally be set to "never".
success-output = "never"

# Cancel the test run on the first failure. For CI runs, consider setting this
# to false.
fail-fast = true

# Treat a test that takes longer than the configured 'period' as slow, and print a message.
# See <https://nexte.st/book/slow-tests> for more information.
#
# Optional: specify the parameter 'terminate-after' with a non-zero integer,
# which will cause slow tests to be terminated after the specified number of
# periods have passed.
# Example: slow-timeout = { period = "60s", terminate-after = 2 }
slow-timeout = { period = "60s" }

# Treat a test as leaky if after the process is shut down, standard output and standard error
# aren't closed within this duration.
#
# This usually happens in case of a test that creates a child process and lets it inherit those
# handles, but doesn't clean the child process up (especially when it fails).
#
# See <https://nexte.st/book/leaky-tests> for more information.
leak-timeout = "100ms"

[profile.ci]
retries = { backoff = "exponential", count = 3, delay = "30s", jitter = true, max-delay = "300s" }
fail-fast = false

[profile.integration]
retries = { backoff = "fixed", count = 2, delay = "1s" }
fail-fast = false


# See https://nexte.st/book/test-groups.html
[test-groups]
serial-integration = { max-threads = 1 }

# All tests with the suffix '_serial' will be run serially
[[profile.default.overrides]]
filter = 'test(/_serial$/)'
test-group = 'serial-integration'
7 changes: 7 additions & 0 deletions wash/.devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# wash devcontainer

A simple devcontainer that has `rust` installed. Try it out with `devcontainer open` at the root of this repository!

## Prerequisites
- [devcontainer CLI](https://code.visualstudio.com/docs/devcontainers/devcontainer-cli#_installation)
- VSCode
26 changes: 26 additions & 0 deletions wash/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "wash",
"image": "rust:bullseye",
"features": {
"devwasm.azurecr.io/dev-wasm/dev-wasm-feature/rust-wasi:0": {},
"ghcr.io/lee-orr/rusty-dev-containers/cargo-binstall:latest": {},
"ghcr.io/lee-orr/rusty-dev-containers/cargo-watch:latest": {},
"ghcr.io/lee-orr/rusty-dev-containers/cargo-nextest:latest": {},
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/lee-orr/rusty-dev-containers/tinygo:0": {
"version": "0.27.0"
}
},
"workspaceMount": "source=${localWorkspaceFolder},target=/wash,type=bind,consistency=cached",
"workspaceFolder": "/wash",
"customizations": {
"vscode": {
"settings": {
"git.alwaysSignOff": true
},
"extensions": [
"rust-lang.rust-analyzer"
]
}
}
}
5 changes: 5 additions & 0 deletions wash/.github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# wasmcloud team members
* @autodidaddict @brooksmtownsend @thomastaylor312 @mattwilkinsonn

# wasmcloud devops
/.github/actions/ @brooksmtownsend @thomastaylor312
31 changes: 31 additions & 0 deletions wash/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG] <Issue>"
labels: bug, help wanted
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Run command '...'
1. Run other command '...'
1. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment (please complete the following information) **
- OS: [e.g. Linux, MacOS]
- Shell [e.g. bash, zsh, powershell]
- wash Version [e.g. 0.2.0]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions wash/.github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE] <feature name>"
labels: enhancement, help wanted
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
20 changes: 20 additions & 0 deletions wash/.github/actions/build-nix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: build via Nix

inputs:
package:
description: package specification to build
required: true
install-path:
description: path within resulting output, from which to install (e.g. `/bin/wash`)

runs:
using: composite
steps:
- run: nix build -L '.#${{ inputs.package }}'
shell: bash
- run: nix run -L --inputs-from . 'nixpkgs#coreutils' -- --coreutils-prog=ginstall -p "./result${{ inputs.install-path }}" '${{ inputs.package }}'
shell: bash
- uses: actions/upload-artifact@v3
with:
name: ${{ inputs.package }}
path: ${{ inputs.package }}
24 changes: 24 additions & 0 deletions wash/.github/actions/install-nix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: install Nix

inputs:
cachixAuthToken:
description: auth token for https://app.cachix.org/organization/wasmcloud/cache/wasmcloud

runs:
using: composite
steps:
# Install Nix
- uses: DeterminateSystems/nix-installer-action@v4
with:
extra-conf: |
accept-flake-config = true
# Setup magic Nix cache
- uses: DeterminateSystems/magic-nix-cache-action@v2

# Setup Cachix cache
- uses: cachix/cachix-action@v12
continue-on-error: true
with:
name: wasmcloud
authToken: '${{ inputs.cachixAuthToken }}'
14 changes: 14 additions & 0 deletions wash/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: npm
directory: "/washboard"
schedule:
interval: "daily"
19 changes: 19 additions & 0 deletions wash/.github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned # Pinned issues should stick around
- security # Security issues need to be resolved
- roadmap # Issue is captured on the wasmCloud roadmap and won't be lost
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. If this
has been closed too eagerly, please feel free to tag a maintainer so we can
keep working on the issue. Thank you for contributing to wasmCloud!
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
120 changes: 120 additions & 0 deletions wash/.github/workflows/docker_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Docker build check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
name: build release assets
runs-on: ${{ matrix.config.os }}
outputs:
version_output: ${{ steps.version_output.outputs.version }}
strategy:
matrix:
config:
# NOTE: We are building on an older version of ubuntu because of libc compatibility
# issues. Namely, if we build on a new version of libc, it isn't backwards compatible with
# old versions. But if we build on the old version, it is compatible with the newer
# versions running in ubuntu 22 and its ilk
- os: "ubuntu-20.04"
arch: "amd64"
extension: ""
targetPath: "target/release/"
- os: "ubuntu-20.04"
arch: "aarch64"
extension: ""
targetPath: "target/aarch64-unknown-linux-gnu/release/"
steps:
- uses: actions/checkout@v4

- name: set the release version (tag)
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: set the release version (main)
if: github.ref == 'refs/heads/main'
shell: bash
run: echo "RELEASE_VERSION=canary" >> $GITHUB_ENV

- name: Output Version
id: version_output
run: echo "version=$RELEASE_VERSION" >> $GITHUB_OUTPUT

- name: lowercase the runner OS name
shell: bash
run: |
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
- name: Install latest Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
if: matrix.config.arch != 'aarch64'
with:
toolchain: stable
components: clippy, rustfmt

- name: setup for cross-compile builds
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
rustup toolchain install stable-aarch64-unknown-linux-gnu
rustup target add --toolchain stable-aarch64-unknown-linux-gnu aarch64-unknown-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV
- name: Install latest Rust stable toolchain
uses: dtolnay/rust-toolchain@stable
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'ubuntu-20.04'
with:
toolchain: stable
components: clippy, rustfmt
target: aarch64-unknown-linux-gnu

- name: build release
if: matrix.config.arch != 'aarch64'
run: "cargo build --release"

- name: build release
if: matrix.config.arch == 'aarch64' && matrix.config.os == 'ubuntu-20.04'
run: "cargo build --release --target aarch64-unknown-linux-gnu"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
wasmcloud/wash
wasmcloud.azurecr.io/wash
tags: |
type=semver,pattern={{version}}
type=sha
flavor: |
latest=auto
labels: |
org.opencontainers.image.title=wash
org.opencontainers.image.description=WAsmcloud SHell
org.opencontainers.image.vendor=wasmCloud
org.opencontainers.image.source=https://github.com/${{ github.repository }}
- name: Docker build
uses: docker/build-push-action@v5
with:
file: "Dockerfile"
context: .
platforms: linux/${{ matrix.config.arch }}
build-args: |
BIN_AMD64=${{ matrix.config.targetPath }}/wash
BIN_ARM64=${{ matrix.config.targetPath }}/wash
labels: ${{ steps.meta.outputs.labels }}
push: false
Loading

0 comments on commit 39281b3

Please sign in to comment.