-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updated results viewer dependencies and fixed sed command * Added sed fix to update-guild.yml * Added tests for the hdr-histogram-wasm * Updated dependencies for config-wasm tests * Updated the comment to show that wasm-pack v0.10.0 works * Renamed tests directory to match config directory * Renamed config_wasm to config-wasm to match hdr-histogram-wasm * Updated the mdbook and wasm-pack versions in the Dockerfile * Updated the workflows - Updated the mdbook and wasm-pack versions - Updated pr and release to build both config-wasm and hdr-histogram-wasm and run tests * Updated the lock file to the latest dependencies * Fixed warning in latest version of Rust rust-lang/rust#79202 * Changed the config-wasm and hdr-histogram-wasm to be scoped '@fs' * extraneous spaces from empty lines * Fixed the names in the Javascript PR workflow * Initial fixes for clippy (failing tests) * Updated babel version
- Loading branch information
1 parent
b0536ea
commit d87c7e0
Showing
44 changed files
with
4,566 additions
and
6,288 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.js' | ||
- '**.ts' | ||
- '**.html' | ||
- '**/package.json' | ||
- '**/package-lock.json' | ||
|
||
name: Pull Request Javascript | ||
jobs: | ||
create-release: | ||
name: Build guide | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Add Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
target: wasm32-unknown-unknown | ||
toolchain: stable | ||
override: true | ||
- name: Add Node.js toolchain | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
|
||
- name: Build Results Viewer and Book | ||
run: | | ||
set -x | ||
# install mdbook and wasm-pack | ||
mkdir ~/bin | ||
PATH=$PATH:~/bin | ||
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.12/mdbook-v0.4.12-x86_64-unknown-linux-gnu.tar.gz \ | ||
| tar -xz -C ~/bin | ||
curl -sSL https://github.com/rustwasm/wasm-pack/releases/download/v0.10.0/wasm-pack-v0.10.0-x86_64-unknown-linux-musl.tar.gz \ | ||
| tar -xz --strip-components=1 -C ~/bin --no-anchored wasm-pack | ||
# setup some envs to various paths for convenience | ||
PROJECT_ROOT=$PWD | ||
GUIDE_DIR=$(realpath $PROJECT_ROOT/guide) | ||
RESULTS_VIEWER_DIR=$(realpath $GUIDE_DIR/results-viewer) | ||
WASM_LIB_DIR=$(realpath $PROJECT_ROOT/lib/hdr-histogram-wasm) | ||
WASM_OUTPUT_DIR=$RESULTS_VIEWER_DIR/lib/hdr-histogram-wasm | ||
# build the hdr-histogram-wasm for the results viewer | ||
cd $WASM_LIB_DIR | ||
wasm-pack build --release -t web -d $WASM_OUTPUT_DIR | ||
cd $WASM_OUTPUT_DIR | ||
sed -i 's/input = .*import\.meta\.url.*/import(".\/hdr_histogram_wasm_bg.wasm");\ninput = require.resolve(".\/hdr_histogram_wasm_bg.wasm")[0][0];/' hdr_histogram_wasm.js | ||
# build the results viewer (which includes putting the output into the book's src) | ||
cd $RESULTS_VIEWER_DIR | ||
npm ci | ||
npm run build | ||
# build the book | ||
cd $GUIDE_DIR | ||
mdbook build |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,12 +139,12 @@ jobs: | |
asset_content_type: application/octet-stream | ||
|
||
|
||
wasm-release: | ||
name: Wasm Pack and Upload | ||
wasm-release-config: | ||
name: Wasm Pack and Upload Config Parser | ||
needs: ['create-release'] | ||
runs-on: ubuntu-latest | ||
env: | ||
working-directory: ./lib/config_wasm | ||
working-directory: ./lib/config-wasm | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download artifacts | ||
|
@@ -181,12 +181,12 @@ jobs: | |
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: install | ||
args: --version 0.8.1 wasm-pack | ||
args: --version 0.10.0 wasm-pack | ||
- name: Create the Web Assembly | ||
id: wasm_pack | ||
run: | | ||
set -x | ||
wasm-pack build --release -t nodejs | ||
wasm-pack build --release -t nodejs --scope fs | ||
working-directory: ${{env.working-directory}} | ||
shell: bash | ||
|
||
|
@@ -197,6 +197,76 @@ jobs: | |
XZ_OPT=-9 tar -C ./ -cJf $asset_name package.json config* | ||
working-directory: ${{env.working-directory}}/pkg/ | ||
|
||
- name: Upload release asset | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ env.RELEASE_UPLOAD_URL }} | ||
asset_path: ${{env.working-directory}}/pkg/${{ env.ASSET_NAME }} | ||
asset_name: ${{ env.ASSET_NAME }} | ||
asset_content_type: application/octet-stream | ||
|
||
|
||
# The hdr-histogram-wasm needs to be build with web rather than nodejs | ||
wasm-release-histogram: | ||
name: Wasm Pack and Upload Histogram | ||
needs: ['create-release'] | ||
runs-on: ubuntu-latest | ||
env: | ||
working-directory: ./lib/hdr-histogram-wasm | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: artifacts | ||
path: artifacts | ||
|
||
- name: Get upload data | ||
id: upload_data | ||
shell: bash | ||
run: | | ||
release_upload_url="$(cat artifacts/release-upload-url)" | ||
echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV | ||
release_version="$(cat artifacts/release-version)" | ||
echo "VERSION=$release_version" >> $GITHUB_ENV | ||
- name: Set Cargo.toml version | ||
id: set_cargo_version | ||
shell: bash | ||
run: | | ||
# remove the leading "v" for subsequent usage | ||
version=${VERSION/v/} | ||
# replace the version value in Cargo.toml with the tag version (so we don't need to create extraneous commits for every preview version) | ||
cp Cargo.toml Cargo2.toml | ||
sed "0,/version = \".*\"/s//version = \"$version\"/" Cargo2.toml > Cargo.toml | ||
working-directory: ${{env.working-directory}} | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: install | ||
args: --version 0.10.0 wasm-pack | ||
- name: Create the Web Assembly | ||
id: wasm_pack | ||
run: | | ||
set -x | ||
wasm-pack build --release -t web --scope fs | ||
working-directory: ${{env.working-directory}} | ||
shell: bash | ||
|
||
- name: Compress for Linux | ||
run: | | ||
asset_name="pewpew-$VERSION-hdr-histogram-wasm.tar.xz" | ||
echo "ASSET_NAME=$asset_name" >> $GITHUB_ENV | ||
XZ_OPT=-9 tar -C ./ -cJf $asset_name package.json config* | ||
working-directory: ${{env.working-directory}}/pkg/ | ||
|
||
- name: Upload release asset | ||
uses: actions/[email protected] | ||
env: | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
/*.txt | ||
/*.dump | ||
/*.log | ||
/*.json | ||
/*.json | ||
node_modules |
Oops, something went wrong.