diff --git a/.github/workflows/build_docs.yaml b/.github/workflows/build_docs.yaml index cafef51096..328e9a0efa 100644 --- a/.github/workflows/build_docs.yaml +++ b/.github/workflows/build_docs.yaml @@ -17,6 +17,95 @@ on: jobs: docs: runs-on: ubuntu-20.04 + env: + # allow deprecated warning because we are using nightly and some things might be deprecated in nightly + # for which the stable alternative is not yet available + RUSTFLAGS: -D warnings -W deprecated + RUSTDOCFLAGS: --html-in-header=/home/runner/work/sixtyfps/sixtyfps/docs/resources/sixtyfps-docs-preview.html --html-in-header=/home/runner/work/sixtyfps/sixtyfps/docs/resources/sixtyfps-docs-highlight.html -D warnings -W deprecated + SIXTYFPS_NO_QT: 1 + CARGO_INCREMENTAL: false + MDBOOK_VERSION: 0.4.10 + MDBOOK_LINKCHECK_VERSION: 0.7.4 steps: - - name: Dummy - run: echo ok \ No newline at end of file + - uses: actions/checkout@v2 + - name: Set up rgb crate rustdoc link + run: | + rgb_version=`grep 'rgb = ' sixtyfps_runtime/corelib/Cargo.toml | sed 's/^.*"\(.*\)"/\1/'` + echo "RUSTDOCFLAGS=$RUSTDOCFLAGS --extern-html-root-url rgb=https://docs.rs/rgb/$rgb_version/ -Z unstable-options" >> $GITHUB_ENV + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: '12' + - name: Cache mdbook and mdbook-linkcheck + uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/mdbook + ~/.cargo/bin/mdbook-linkcheck + key: ${{ runner.os }}-${{ github.job }}-mdbook-${{ env.MDBOOK_VERSION }}-${{ env.MDBOOK_LINKCHECK_VERSION }} + - name: Install nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + - uses: Swatinem/rust-cache@v1 + - name: Install mdbook + run: cargo install mdbook --version ${{ env.MDBOOK_VERSION }} || true + - name: Install mdbook-linkcheck + run: cargo install mdbook-linkcheck --version ${{ env.MDBOOK_LINKCHECK_VERSION }} || true + - name: Install doxygen + run: sudo apt-get install doxygen + - name: Upgrade pip and install pipenv + run: | + python -m pip install --upgrade pip + pip install --user pipenv + - name: Cache Pipenv virtualenv + uses: actions/cache@v2 + id: pipenv-cache + with: + path: ~/.local/share/virtualenvs + key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile') }} + restore-keys: | + ${{ runner.os }}-pipenv- + - name: Remove docs from cache # Avoid stale docs + run: | + rm -rf target/doc target/cppdocs api/sixtyfps-node/docs + - name: Check formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check + - name: Check license headers + run: cargo xtask check_license_headers --show-all + - name: Build Cpp docs + run: cargo xtask cppdocs --show-warnings + - name: "Rust docs" + uses: actions-rs/cargo@v1 + with: + command: doc + toolchain: nightly + args: -p sixtyfps -p sixtyfps-build -p sixtyfps-interpreter --no-deps --all-features + - name: "Rust Tutorial Docs" + run: mdbook build + working-directory: docs/tutorial/rust + - name: "C++ Tutorial Docs" + run: mdbook build + working-directory: docs/tutorial/cpp + - name: "Node docs" + run: | + npm install --ignore-scripts + npm run docs + working-directory: api/sixtyfps-node + - name: "Upload Docs Artifacts" + uses: actions/upload-artifact@v2 + with: + name: docs + path: | + target/doc + target/cppdocs/html + api/sixtyfps-node/docs + docs/tutorial/rust/book/html + docs/tutorial/cpp/book/html + - name: Clean cache # Don't cache docs to avoid them including removed classes being published + run: | + rm -rf target/doc target/cppdocs api/sixtyfps-node/docs docs/tutorial/rust/book docs/tutorial/cpp/book + diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eb5ce973dd..7af09ad3b5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -228,14 +228,6 @@ jobs: toolchain: stable override: true - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/install@v0.1 - if: matrix.os == 'windows-latest' - with: - crate: cargo-about - use-tool-cache: true - - name: Prepare licenses - if: matrix.os == 'windows-latest' - run: bash -x ./scripts/prepare_binary_package.sh . ..\Qt 6.2.1 - uses: ilammy/msvc-dev-cmd@v1 - name: Select MSVC (windows) run: | @@ -251,236 +243,21 @@ jobs: with: cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsTxtPath: CMakeLists.txt - cmakeAppendedArgs: '-DBUILD_TESTING=ON -DSIXTYFPS_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSIXTYFPS_PACKAGE_BUNDLE_QT=ON' + cmakeAppendedArgs: '-DBUILD_TESTING=ON -DSIXTYFPS_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Debug' buildDirectory: ${{ runner.workspace }}/cppbuild - buildWithCMakeArgs: '--config Release' + buildWithCMakeArgs: '--config Debug' - name: ctest working-directory: ${{ runner.workspace }}/cppbuild run: ctest --verbose - - name: cpack - working-directory: ${{ runner.workspace }}/cppbuild - run: cmake --build . --config Release --target package - - name: "Upload C++ packages" - uses: actions/upload-artifact@v2 - with: - name: cpp_bin - path: ${{ runner.workspace }}/cppbuild/SixtyFPS-* - docs: - runs-on: ubuntu-20.04 - env: - # allow deprecated warning because we are using nightly and some things might be deprecated in nightly - # for which the stable alternative is not yet available - RUSTFLAGS: -D warnings -W deprecated - RUSTDOCFLAGS: --html-in-header=/home/runner/work/sixtyfps/sixtyfps/docs/resources/sixtyfps-docs-preview.html --html-in-header=/home/runner/work/sixtyfps/sixtyfps/docs/resources/sixtyfps-docs-highlight.html -D warnings -W deprecated - SIXTYFPS_NO_QT: 1 - CARGO_INCREMENTAL: false - MDBOOK_VERSION: 0.4.10 - MDBOOK_LINKCHECK_VERSION: 0.7.4 - steps: - - uses: actions/checkout@v2 - - name: Set up rgb crate rustdoc link - run: | - rgb_version=`grep 'rgb = ' sixtyfps_runtime/corelib/Cargo.toml | sed 's/^.*"\(.*\)"/\1/'` - echo "RUSTDOCFLAGS=$RUSTDOCFLAGS --extern-html-root-url rgb=https://docs.rs/rgb/$rgb_version/ -Z unstable-options" >> $GITHUB_ENV - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: '12' - - name: Cache mdbook and mdbook-linkcheck - uses: actions/cache@v2 - with: - path: | - ~/.cargo/bin/mdbook - ~/.cargo/bin/mdbook-linkcheck - key: ${{ runner.os }}-${{ github.job }}-mdbook-${{ env.MDBOOK_VERSION }}-${{ env.MDBOOK_LINKCHECK_VERSION }} - - name: Install nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - - uses: Swatinem/rust-cache@v1 - - name: Install mdbook - run: cargo install mdbook --version ${{ env.MDBOOK_VERSION }} || true - - name: Install mdbook-linkcheck - run: cargo install mdbook-linkcheck --version ${{ env.MDBOOK_LINKCHECK_VERSION }} || true - - name: Install doxygen - run: sudo apt-get install doxygen - - name: Upgrade pip and install pipenv - run: | - python -m pip install --upgrade pip - pip install --user pipenv - - name: Cache Pipenv virtualenv - uses: actions/cache@v2 - id: pipenv-cache - with: - path: ~/.local/share/virtualenvs - key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile') }} - restore-keys: | - ${{ runner.os }}-pipenv- - - name: Remove docs from cache # Avoid stale docs - run: | - rm -rf target/doc target/cppdocs api/sixtyfps-node/docs - - name: Check formatting - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check - - name: Check license headers - run: cargo xtask check_license_headers --show-all - - name: Build Cpp docs - run: cargo xtask cppdocs --show-warnings - - name: "Rust docs" - uses: actions-rs/cargo@v1 - with: - command: doc - toolchain: nightly - args: -p sixtyfps -p sixtyfps-build -p sixtyfps-interpreter --no-deps --all-features - - name: "Rust Tutorial Docs" - run: mdbook build - working-directory: docs/tutorial/rust - - name: "C++ Tutorial Docs" - run: mdbook build - working-directory: docs/tutorial/cpp - - name: "Node docs" - run: | - npm install --ignore-scripts - npm run docs - working-directory: api/sixtyfps-node - - name: "Upload Docs Artifacts" - uses: actions/upload-artifact@v2 - with: - name: docs - path: | - target/doc - target/cppdocs/html - api/sixtyfps-node/docs - docs/tutorial/rust/book/html - docs/tutorial/cpp/book/html - - name: Clean cache # Don't cache docs to avoid them including removed classes being published - run: | - rm -rf target/doc target/cppdocs api/sixtyfps-node/docs docs/tutorial/rust/book docs/tutorial/cpp/book + uses: sixtyfpsui/sixtyfps/.github/workflows/build_docs.yaml@master wasm: - env: - CARGO_PROFILE_RELEASE_OPT_LEVEL: s - CARGO_INCREMENTAL: false - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v1 - with: - node-version: '12' - - id: nodeversion - run: | - echo "::set-output name=node-version::$(node --version)" - - uses: actions/cache@v2 - with: - path: ~/.npm - key: ${{ runner.os }}-${{ github.job }}-node-${{ hashFiles('examples/**/package.json', 'api/**/package.json') }} - restore-keys: | - ${{ runner.os }}-${{ github.job }}-node- - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - target: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v1 - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Compile sixtyfps-wasm-interpreter - run: wasm-pack build --release --target web -- --features console_error_panic_hook - working-directory: api/sixtyfps-wasm-interpreter - - name: Compile online editor - run: | - npm install - npm run build - working-directory: tools/online_editor - - name: "Upload wasm Artifacts" - uses: actions/upload-artifact@v2 - with: - name: wasm - path: | - api/sixtyfps-wasm-interpreter/pkg/ - tools/online_editor/dist/ + uses: sixtyfpsui/sixtyfps/.github/workflows/wasm_editor_and_interpreter.yaml@master wasm_demo: - env: - CARGO_PROFILE_RELEASE_OPT_LEVEL: s - CARGO_INCREMENTAL: false - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - name: Install latest stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - target: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v1 - - name: Install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Gallery WASM build - run: | - sed -i "s/#wasm# //" Cargo.toml - wasm-pack build --release --target web - working-directory: examples/gallery - - name: Printer demo WASM build - run: | - sed -i "s/#wasm# //" Cargo.toml - wasm-pack build --release --target web - working-directory: examples/printerdemo/rust - - name: Printer demo old WASM build - run: | - sed -i "s/#wasm# //" Cargo.toml - wasm-pack build --release --target web - working-directory: examples/printerdemo_old/rust - - name: Todo demo WASM build - run: | - sed -i "s/#wasm# //" Cargo.toml - wasm-pack build --release --target web - working-directory: examples/todo/rust - - name: Sliding Puzzle demo WASM build - run: | - sed -i "s/#wasm# //" Cargo.toml - wasm-pack build --release --target web - working-directory: examples/slide_puzzle - - name: Memory example WASM build - run: | - sed -i "s/#wasm# //" Cargo.toml - wasm-pack build --release --target web - working-directory: examples/memory - - name: Imagefilter example WASM build - run: | - sed -i "s/#wasm# //" Cargo.toml - wasm-pack build --release --target web - working-directory: examples/imagefilter - - name: Plotter example WASM build - run: | - sed -i "s/#wasm# //" Cargo.toml - wasm-pack build --release --target web - working-directory: examples/plotter - - name: "Upload Demo Artifacts" - uses: actions/upload-artifact@v2 - with: - name: wasm_demo - path: | - examples/gallery/ - examples/printerdemo/rust/ - examples/printerdemo_old/rust/ - examples/todo/ - examples/memory/ - examples/slide_puzzle/ - examples/imagefilter/ - examples/plotter/ - - name: Clean cache # Otherwise the cache is much too big - run: | - du -hs target - rm -rf target/*/incremental - rm -rf target/*/*/*sixtyfps* - du -hs target + uses: sixtyfpsui/sixtyfps/.github/workflows/wasm_demos.yaml@master # Checkout a old version of the tests and example, then run the syntax_updater on them # and check that it worked with the interpreter test. @@ -538,70 +315,3 @@ jobs: # skip example_printerdemo_old because that was not in 0.0.5 # skip test_interpreter_examples_rotate because the internal rotate element was removed args: --bin test-driver-interpreter -- --skip example_printerdemo_old --skip test_interpreter_examples_rotate - - publish: - if: github.ref == 'refs/heads/master' && github.event_name == 'push' - needs: [build_and_test, cpp_cmake, cpp_test_driver, docs, wasm, wasm_demo, updater_test] # also depends on build_and_test and cpp to only publish if tests are green - runs-on: ubuntu-20.04 - steps: - - uses: actions/download-artifact@v2 - with: - name: docs - - uses: actions/download-artifact@v2 - with: - name: wasm - - uses: actions/download-artifact@v2 - with: - name: wasm_demo - - name: Publish Docs and Demos - run: | - git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git config --global user.name "${GITHUB_ACTOR}" - git clone "https://tronical:${{ secrets.WWW_PUBLISH_SECRET }}@github.com/sixtyfpsui/www" --depth 1 - cd www - - target_branch=${GITHUB_REF##*/} - - rm -rf snapshots/$target_branch/demos - mkdir -p snapshots/$target_branch/demos - - for demo_subdir in gallery, printerdemo,rust printerdemo_old,rust todo,rust slide_puzzle, memory, imagefilter, plotter,; do - IFS=',' read demo subdir <<< "${demo_subdir}" - - mkdir -p snapshots/$target_branch/demos/$demo - cp -a ../$demo/$subdir/{pkg,index.html} snapshots/$target_branch/demos/$demo/ - rm snapshots/$target_branch/demos/$demo/pkg/.gitignore - done - - git add snapshots/$target_branch/demos - git add -u snapshots/$target_branch/demos - - rm -rf snapshots/$target_branch/wasm-interpreter - mkdir -p snapshots/$target_branch/wasm-interpreter - cp -a ../api/sixtyfps-wasm-interpreter/pkg/* ./snapshots/$target_branch/wasm-interpreter/ - git add snapshots/$target_branch/wasm-interpreter - git add -u snapshots/$target_branch/wasm-interpreter - - rm -rf snapshots/$target_branch/editor - mkdir -p snapshots/$target_branch/editor - cp -a ../tools/online_editor/dist/* snapshots/$target_branch/editor/ - git add snapshots/$target_branch/editor - git add -u snapshots/$target_branch/editor - - rm -rf snapshots/$target_branch/docs - mkdir -p snapshots/$target_branch/docs - mkdir -p snapshots/$target_branch/docs/cpp - cp -a ../target/cppdocs/html/* snapshots/$target_branch/docs/cpp/ - mkdir -p snapshots/$target_branch/docs/rust - cp -a ../target/doc/* snapshots/$target_branch/docs/rust/ - mkdir -p snapshots/$target_branch/docs/tutorial/rust - cp -a ../docs/tutorial/rust/book/html/* snapshots/$target_branch/docs/tutorial/rust - mkdir -p snapshots/$target_branch/docs/tutorial/cpp - cp -a ../docs/tutorial/cpp/book/html/* snapshots/$target_branch/docs/tutorial/cpp - mkdir -p snapshots/$target_branch/docs/node - cp -a ../api/sixtyfps-node/docs/* snapshots/$target_branch/docs/node/ - git add snapshots/$target_branch/docs - git add -u snapshots/$target_branch/docs - - git commit --message "Update $NAME from $GITHUB_REPOSITORY" --message "Pull web demos and C++/Rust reference docs from commit $GITHUB_SHA ($GITHUB_REF)" - git push origin master diff --git a/.github/workflows/cpp_package.yaml b/.github/workflows/cpp_package.yaml new file mode 100644 index 0000000000..5063b1ec01 --- /dev/null +++ b/.github/workflows/cpp_package.yaml @@ -0,0 +1,90 @@ +# LICENSE BEGIN +# This file is part of the SixtyFPS Project -- https://sixtyfps.io +# Copyright (c) 2021 Olivier Goffart +# Copyright (c) 2021 Simon Hausmann +# +# SPDX-License-Identifier: GPL-3.0-only +# This file is also available under commercial licensing terms. +# Please contact info@sixtyfps.io for more information. +# LICENSE END +name: Build the C++ binary package + +on: + workflow_dispatch: + workflow_call: + +jobs: + cmake_package: + env: + DYLD_FRAMEWORK_PATH: /Users/runner/work/sixtyfps/Qt/6.2.1/clang_64/lib + QT_QPA_PLATFORM: offscreen + CARGO_INCREMENTAL: false + strategy: + matrix: + os: [ubuntu-20.04, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - name: Install Linux Dependencies + if: matrix.os == 'ubuntu-20.04' + run: sudo apt-get install libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev + - name: Cache Qt + if: matrix.os != 'windows-latest' + id: cache-qt + uses: actions/cache@v2 + with: + path: ~/work/sixtyfps/Qt + key: ${{ runner.os }}-${{ github.job }}-cpp-qt + - name: Install Qt (Ubuntu) + uses: jurplel/install-qt-action@v2 + if: matrix.os == 'ubuntu-20.04' + with: + version: 5.15.2 + cached: ${{ steps.cache-qt.outputs.cache-hit }} + - name: Install Qt (Windows, uncached) + if: matrix.os == 'windows-latest' + uses: jurplel/install-qt-action@v2 + with: + version: 6.2.1 + - name: Install Qt (cached) + if: matrix.os != 'ubuntu-20.04' && matrix.os != 'windows-latest' + uses: jurplel/install-qt-action@v2 + with: + version: 6.2.1 + cached: ${{ steps.cache-qt.outputs.cache-hit }} + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/install@v0.1 + if: matrix.os == 'windows-latest' + with: + crate: cargo-about + use-tool-cache: true + - name: Prepare licenses + if: matrix.os == 'windows-latest' + run: bash -x ./scripts/prepare_binary_package.sh . ..\Qt 6.2.1 + - uses: ilammy/msvc-dev-cmd@v1 + - name: Select MSVC (windows) + run: | + echo "CC=cl.exe" >> $GITHUB_ENV + echo "CXX=cl.exe" >> $GITHUB_ENV + if: matrix.os == 'windows-latest' + - name: C++ Build + uses: lukka/run-cmake@v3.4 + with: + cmakeListsOrSettingsJson: CMakeListsTxtAdvanced + cmakeListsTxtPath: CMakeLists.txt + cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DSIXTYFPS_PACKAGE_BUNDLE_QT=ON' + buildDirectory: ${{ runner.workspace }}/cppbuild + buildWithCMakeArgs: '--config Release' + - name: cpack + working-directory: ${{ runner.workspace }}/cppbuild + run: cmake --build . --config Release --target package + - name: "Upload C++ packages" + uses: actions/upload-artifact@v2 + with: + name: cpp_bin + path: ${{ runner.workspace }}/cppbuild/SixtyFPS-* diff --git a/.github/workflows/nightly_snapshot.yaml b/.github/workflows/nightly_snapshot.yaml index 704ed57399..9631a91dec 100644 --- a/.github/workflows/nightly_snapshot.yaml +++ b/.github/workflows/nightly_snapshot.yaml @@ -12,11 +12,87 @@ name: Nightly snapshot on: workflow_dispatch: - + inputs: + publish: + type: boolean + default: "false" + required: false jobs: + sixtyfps-viewer-binary: + uses: sixtyfpsui/sixtyfps/.github/workflows/sixtyfps_viewer_binary.yaml@master + docs: + uses: sixtyfpsui/sixtyfps/.github/workflows/build_docs.yaml@master + wasm_demo: + uses: sixtyfpsui/sixtyfps/.github/workflows/wasm_demos.yaml@master + wasm: + uses: sixtyfpsui/sixtyfps/.github/workflows/wasm_editor_and_interpreter.yaml@master + cpp_package: + uses: sixtyfpsui/sixtyfps/.github/workflows/cpp_package.yaml@master publish: + if: github.event.inputs.publish && github.ref == 'refs/heads/master' + needs: [docs, wasm_demo, wasm] runs-on: ubuntu-20.04 steps: - - name: Dummy - run: echo ok + - uses: actions/download-artifact@v2 + with: + name: docs + - uses: actions/download-artifact@v2 + with: + name: wasm + - uses: actions/download-artifact@v2 + with: + name: wasm_demo + - name: Publish Docs and Demos + run: | + git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" + git config --global user.name "${GITHUB_ACTOR}" + git clone "https://tronical:${{ secrets.WWW_PUBLISH_SECRET }}@github.com/sixtyfpsui/www" --depth 1 + cd www + + target_branch=${GITHUB_REF##*/} + + rm -rf snapshots/$target_branch/demos + mkdir -p snapshots/$target_branch/demos + + for demo_subdir in gallery, printerdemo,rust printerdemo_old,rust todo,rust slide_puzzle, memory, imagefilter, plotter,; do + IFS=',' read demo subdir <<< "${demo_subdir}" + + mkdir -p snapshots/$target_branch/demos/$demo + cp -a ../$demo/$subdir/{pkg,index.html} snapshots/$target_branch/demos/$demo/ + rm snapshots/$target_branch/demos/$demo/pkg/.gitignore + done + + git add snapshots/$target_branch/demos + git add -u snapshots/$target_branch/demos + + rm -rf snapshots/$target_branch/wasm-interpreter + mkdir -p snapshots/$target_branch/wasm-interpreter + cp -a ../api/sixtyfps-wasm-interpreter/pkg/* ./snapshots/$target_branch/wasm-interpreter/ + git add snapshots/$target_branch/wasm-interpreter + git add -u snapshots/$target_branch/wasm-interpreter + + rm -rf snapshots/$target_branch/editor + mkdir -p snapshots/$target_branch/editor + cp -a ../tools/online_editor/dist/* snapshots/$target_branch/editor/ + git add snapshots/$target_branch/editor + git add -u snapshots/$target_branch/editor + + rm -rf snapshots/$target_branch/docs + mkdir -p snapshots/$target_branch/docs + mkdir -p snapshots/$target_branch/docs/cpp + cp -a ../target/cppdocs/html/* snapshots/$target_branch/docs/cpp/ + mkdir -p snapshots/$target_branch/docs/rust + cp -a ../target/doc/* snapshots/$target_branch/docs/rust/ + mkdir -p snapshots/$target_branch/docs/tutorial/rust + cp -a ../docs/tutorial/rust/book/html/* snapshots/$target_branch/docs/tutorial/rust + mkdir -p snapshots/$target_branch/docs/tutorial/cpp + cp -a ../docs/tutorial/cpp/book/html/* snapshots/$target_branch/docs/tutorial/cpp + mkdir -p snapshots/$target_branch/docs/node + cp -a ../api/sixtyfps-node/docs/* snapshots/$target_branch/docs/node/ + git add snapshots/$target_branch/docs + git add -u snapshots/$target_branch/docs + + git commit --message "Update $NAME from $GITHUB_REPOSITORY" --message "Pull web demos and C++/Rust reference docs from commit $GITHUB_SHA ($GITHUB_REF)" + git push origin master + diff --git a/.github/workflows/sixtyfps_viewer_binary.yaml b/.github/workflows/sixtyfps_viewer_binary.yaml index 3f7258dfa5..edacba8ab8 100644 --- a/.github/workflows/sixtyfps_viewer_binary.yaml +++ b/.github/workflows/sixtyfps_viewer_binary.yaml @@ -11,6 +11,7 @@ name: Build sixtyfps-viewer binary on: workflow_dispatch: + workflow_call: jobs: build_windows: diff --git a/.github/workflows/wasm_demos.yaml b/.github/workflows/wasm_demos.yaml index f7287fbac3..0d26349e25 100644 --- a/.github/workflows/wasm_demos.yaml +++ b/.github/workflows/wasm_demos.yaml @@ -15,7 +15,77 @@ on: jobs: wasm_demo: + env: + CARGO_PROFILE_RELEASE_OPT_LEVEL: s + CARGO_INCREMENTAL: false runs-on: ubuntu-20.04 steps: - - name: Dummy - run: echo ok + - uses: actions/checkout@v2 + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + target: wasm32-unknown-unknown + - uses: Swatinem/rust-cache@v1 + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Gallery WASM build + run: | + sed -i "s/#wasm# //" Cargo.toml + wasm-pack build --release --target web + working-directory: examples/gallery + - name: Printer demo WASM build + run: | + sed -i "s/#wasm# //" Cargo.toml + wasm-pack build --release --target web + working-directory: examples/printerdemo/rust + - name: Printer demo old WASM build + run: | + sed -i "s/#wasm# //" Cargo.toml + wasm-pack build --release --target web + working-directory: examples/printerdemo_old/rust + - name: Todo demo WASM build + run: | + sed -i "s/#wasm# //" Cargo.toml + wasm-pack build --release --target web + working-directory: examples/todo/rust + - name: Sliding Puzzle demo WASM build + run: | + sed -i "s/#wasm# //" Cargo.toml + wasm-pack build --release --target web + working-directory: examples/slide_puzzle + - name: Memory example WASM build + run: | + sed -i "s/#wasm# //" Cargo.toml + wasm-pack build --release --target web + working-directory: examples/memory + - name: Imagefilter example WASM build + run: | + sed -i "s/#wasm# //" Cargo.toml + wasm-pack build --release --target web + working-directory: examples/imagefilter + - name: Plotter example WASM build + run: | + sed -i "s/#wasm# //" Cargo.toml + wasm-pack build --release --target web + working-directory: examples/plotter + - name: "Upload Demo Artifacts" + uses: actions/upload-artifact@v2 + with: + name: wasm_demo + path: | + examples/gallery/ + examples/printerdemo/rust/ + examples/printerdemo_old/rust/ + examples/todo/ + examples/memory/ + examples/slide_puzzle/ + examples/imagefilter/ + examples/plotter/ + - name: Clean cache # Otherwise the cache is much too big + run: | + du -hs target + rm -rf target/*/incremental + rm -rf target/*/*/*sixtyfps* + du -hs target diff --git a/.github/workflows/wasm_editor_and_interpreter.yaml b/.github/workflows/wasm_editor_and_interpreter.yaml index a1592aa538..3ab8e1a1e4 100644 --- a/.github/workflows/wasm_editor_and_interpreter.yaml +++ b/.github/workflows/wasm_editor_and_interpreter.yaml @@ -15,7 +15,46 @@ on: jobs: wasm: + env: + CARGO_PROFILE_RELEASE_OPT_LEVEL: s + CARGO_INCREMENTAL: false runs-on: ubuntu-20.04 steps: - - name: Dummy - run: echo ok \ No newline at end of file + - uses: actions/checkout@v2 + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: '12' + - id: nodeversion + run: | + echo "::set-output name=node-version::$(node --version)" + - uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-${{ github.job }}-node-${{ hashFiles('examples/**/package.json', 'api/**/package.json') }} + restore-keys: | + ${{ runner.os }}-${{ github.job }}-node- + - name: Install latest stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + target: wasm32-unknown-unknown + - uses: Swatinem/rust-cache@v1 + - name: Install wasm-pack + run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Compile sixtyfps-wasm-interpreter + run: wasm-pack build --release --target web -- --features console_error_panic_hook + working-directory: api/sixtyfps-wasm-interpreter + - name: Compile online editor + run: | + npm install + npm run build + working-directory: tools/online_editor + - name: "Upload wasm Artifacts" + uses: actions/upload-artifact@v2 + with: + name: wasm + path: | + api/sixtyfps-wasm-interpreter/pkg/ + tools/online_editor/dist/