This repository has been archived by the owner on Sep 21, 2024. It is now read-only.
chore: Remove vestigial getrandom dependency #2389
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
pull_request: | |
name: Run test suite | |
jobs: | |
build-noosphere-apple-artifacts: | |
name: 'Build Noosphere artifacts (Apple)' | |
uses: ./.github/workflows/noosphere_apple_build.yaml | |
with: | |
for-test: true | |
run-test-suite-mac-os-swift: | |
runs-on: macos-12 | |
needs: ['build-noosphere-apple-artifacts'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Download XCode Framework artifact' | |
uses: actions/download-artifact@v3 | |
with: | |
name: libnoosphere_apple_framework | |
- name: 'Run Swift tests' | |
run: | | |
unzip ./libnoosphere-apple-xcframework.zip | |
sed -i '' -e "s#url: \"[^\"]*\",#path: \"./LibNoosphere.xcframework\"),#" ./Package.swift | |
sed -i '' -e "s#checksum: \"[^\"]*\"),##" ./Package.swift | |
# Enable malloc debugging features | |
# https://developer.apple.com/library/archive/documentation/Performance/Conceptual/ManagingMemory/Articles/MallocDebug.html | |
export MallocPreScribble=1 | |
export MallocScribble=1 | |
swift build --sanitize=address | |
swift test --sanitize=address | |
run-linting-linux: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
matrix: | |
include: | |
- toolchain: stable | |
- toolchain: nightly | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
- name: 'Setup Rust' | |
run: | | |
curl -sSf https://sh.rustup.rs | sh -s -- -y | |
rustup toolchain install ${{matrix.toolchain}} | |
rustup +${{matrix.toolchain}} component add clippy | |
rustup +${{matrix.toolchain}} component add rustfmt | |
- name: 'Install environment packages' | |
run: | | |
sudo apt-get update -qqy | |
sudo apt-get install jq protobuf-compiler cmake | |
- name: 'Check Format' | |
run: cargo +${{matrix.toolchain}} fmt --all -- --check | |
- name: 'Run Linter' | |
run: cargo +${{matrix.toolchain}} clippy --all -- -D warnings | |
run-rust-test-suite: | |
name: 'Run Rust test suite' | |
continue-on-error: true | |
strategy: | |
matrix: | |
features: ['test-kubo,headers', 'test-kubo,headers,rocksdb'] | |
platform: ['ubuntu-latest', 'windows-latest', 'macos-13'] | |
toolchain: ['stable', 'nightly'] | |
exclude: | |
- platform: 'windows-latest' | |
features: 'test-kubo,headers,rocksdb' | |
- platform: 'macos-13' | |
toolchain: 'nightly' | |
- platform: 'windows-latest' | |
toolchain: 'nightly' | |
- features: 'test-kubo,headers,rocksdb' | |
toolchain: 'nightly' | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
- name: 'Setup Rust' | |
run: | | |
curl -sSf https://sh.rustup.rs | sh -s -- -y | |
rustup toolchain install ${{matrix.toolchain}} | |
- name: 'Install environment packages (Windows)' | |
if: ${{ matrix.platform == 'windows-latest' }} | |
run: | | |
choco install -y cmake protoc | |
shell: sh | |
- name: 'Install environment packages (Linux)' | |
if: ${{ matrix.platform == 'ubuntu-latest' }} | |
run: | | |
sudo apt-get update -qqy | |
sudo apt-get install jq protobuf-compiler cmake | |
- name: 'Install IPFS Kubo' | |
uses: ibnesayeed/setup-ipfs@master | |
with: | |
ipfs_version: v0.17.0 | |
run_daemon: true | |
- name: Install cargo-binstall | |
uses: cargo-bins/[email protected] | |
- name: Install binaries from cargo | |
run: | | |
cargo +${{ matrix.toolchain }} binstall cargo-nextest --no-confirm --force | |
- name: 'Run Rust tests' | |
shell: bash | |
run: | | |
mkdir -p test-results | |
echo "${{ matrix.platform }} | |
${{ matrix.features }} | |
${{ matrix.toolchain}}" > test-results/target | |
UCAN_FEATURES="noosphere-ucan/p256,noosphere-ucan/rsa,noosphere-ucan/ed25519" | |
FEATURES="$UCAN_FEATURES" | |
if [ -n "${{matrix.features}}" ]; then | |
FEATURES="--features ${{matrix.features}},$UCAN_FEATURES" | |
fi | |
cargo +${{ matrix.toolchain }} nextest run $FEATURES --profile ci --color always 2>&1 | tee test-results/log | |
env: | |
NOOSPHERE_LOG: academic | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: test-results-${{ hashFiles('./test-results') }} | |
path: ./test-results | |
report-test-flakes: | |
name: 'Report test flakes (Linux)' | |
needs: ['run-rust-test-suite'] | |
if: github.ref != 'refs/heads/main' | |
uses: ./.github/workflows/report_test_flakes.yaml | |
secrets: inherit | |
run-test-suite-linux-c: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
- name: 'Setup Rust' | |
run: | | |
curl -sSf https://sh.rustup.rs | sh -s -- -y | |
- name: 'Install environment packages' | |
run: | | |
sudo apt-get update -qqy | |
sudo apt-get install jq protobuf-compiler cmake make | |
- name: 'Link Noosphere from C' | |
run: | | |
make build -C ./c/example | |
- name: 'Run C integration tests' | |
run: | | |
make run -C ./c/example | |
run-test-suite-web-wasm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
- name: 'Setup Rust' | |
run: | | |
curl -sSf https://sh.rustup.rs | sh -s -- -y | |
rustup component add clippy | |
rustup component add rustfmt | |
- name: 'Install environment packages' | |
run: | | |
sudo apt-get update -qqy | |
sudo apt-get install jq protobuf-compiler cmake | |
- name: 'Install Rust/WASM test dependencies' | |
run: | | |
rustup target install wasm32-unknown-unknown | |
cargo install toml-cli | |
WASM_BINDGEN_VERSION=`toml get ./Cargo.lock . | jq '.package | map(select(.name == "wasm-bindgen"))[0].version' | xargs echo` | |
cargo install wasm-bindgen-cli --vers "$WASM_BINDGEN_VERSION" | |
shell: bash | |
# See: https://github.com/SeleniumHQ/selenium/blob/5d108f9a679634af0bbc387e7e3811bc1565912b/.github/actions/setup-chrome/action.yml | |
- name: 'Setup Chrome and chromedriver' | |
run: | | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list.d/google-chrome.list | |
sudo apt-get update -qqy | |
sudo apt-get -qqy install google-chrome-stable | |
CHROMEDRIVER_URL=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | | |
jq -r '.channels.Stable.downloads.chromedriver | map(select(.platform == "linux64")) | first.url') | |
curl -L -O "$CHROMEDRIVER_URL" | |
unzip chromedriver-linux64.zip | |
pushd ./chromedriver-linux64 | |
chmod +x chromedriver | |
sudo mv chromedriver /usr/local/bin | |
popd | |
chromedriver -version | |
shell: bash | |
- name: 'Run Rust headless browser tests' | |
working-directory: ./rust | |
run: | | |
WASM_UCAN_FEATURES="noosphere-ucan/web-crypto-rsa,noosphere-ucan/p256,noosphere-ucan/rsa,noosphere-ucan/ed25519" | |
CHROMEDRIVER=/usr/local/bin/chromedriver cargo test --target wasm32-unknown-unknown --features $WASM_UCAN_FEATURES | |
shell: bash | |
run-test-suite-web-typescript: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
# Disable wireit cache for now, seeing some errors pop up: | |
# https://github.com/subconsciousnetwork/noosphere/actions/runs/4682179827/jobs/8295693844 | |
# - uses: google/wireit@setup-github-actions-caching/v1 | |
- name: 'Setup Rust' | |
run: | | |
curl -sSf https://sh.rustup.rs | sh -s -- -y | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
- name: 'Install environment packages' | |
run: | | |
sudo apt-get update -qqy | |
sudo apt-get install jq protobuf-compiler cmake | |
- name: 'Install Rust/WASM test dependencies' | |
run: | | |
rustup target install wasm32-unknown-unknown | |
cargo install toml-cli | |
WASM_BINDGEN_VERSION=`toml get ./Cargo.lock . | jq '.package | map(select(.name == "wasm-bindgen"))[0].version' | xargs echo` | |
cargo install wasm-bindgen-cli --vers "$WASM_BINDGEN_VERSION" | |
cargo install wasm-opt --locked | |
shell: bash | |
# See: https://github.com/SeleniumHQ/selenium/blob/5d108f9a679634af0bbc387e7e3811bc1565912b/.github/actions/setup-chrome/action.yml | |
- name: 'Setup Chrome and chromedriver' | |
run: | | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list.d/google-chrome.list | |
sudo apt-get update -qqy | |
sudo apt-get -qqy install google-chrome-stable | |
CHROMEDRIVER_URL=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | | |
jq -r '.channels.Stable.downloads.chromedriver | map(select(.platform == "linux64")) | first.url') | |
curl -L -O "$CHROMEDRIVER_URL" | |
unzip chromedriver-linux64.zip | |
pushd ./chromedriver-linux64 | |
chmod +x chromedriver | |
sudo mv chromedriver /usr/local/bin | |
popd | |
chromedriver -version | |
shell: bash | |
- name: 'Install NPM dependencies' | |
working-directory: ./typescript | |
run: npm ci | |
- name: 'Run TypeScript headless browser tests' | |
working-directory: ./typescript | |
run: npm run build && npm run test |