name: Build on: pull_request: push: branches: - 'master' tags: - '*' env: CARGO_TERM_COLOR: always jobs: build: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: label: # Bare Metal - Bare Metal Nvidia PTX 64 - Bare Metal ARM Cortex-M thumbv6m - Bare Metal ARM Cortex-M thumbv7em - Bare Metal ARM Cortex-M thumbv7em Hardware Float - Bare Metal ARM Cortex-M thumbv7m - Bare Metal ARM Cortex-M thumbv8m.base - Bare Metal ARM Cortex-M thumbv8m.main - Bare Metal ARM Cortex-M thumbv8m.main Hardware Float # FIXME: RISC-V without atomics doesn't work with ahash # - Bare Metal RISC-V 32 i # - Bare Metal RISC-V 32 imc - Bare Metal RISC-V 32 imac - Bare Metal RISC-V 64 gc - Bare Metal RISC-V 64 imac # WebAssembly - WebAssembly Unknown - WebAssembly Web - WebAssembly WASI # Windows - Windows aarch64 # FIXME: The `windows` crate doesn't compile on this target. # - Windows i586 - Windows i686 - Windows x86_64 - Windows i686 gnu - Windows x86_64 gnu # Linux - Linux i586 - Linux i586 musl - Linux i686 - Linux i686 musl - Linux x86_64 - Linux x86_64 musl - Linux x86_64 gnux32 - Linux arm - Linux arm musl - Linux arm Hardware Float - Linux arm musl Hardware Float - Linux armv5te - Linux armv5te musl - Linux armv7 Hardware Float - Linux armv7 musl Hardware Float - Linux aarch64 - Linux mips - Linux mips64 - Linux mips64el - Linux mipsel - Linux mipsel musl # Unstable # - env: TARGET=mipsisa32r6-unknown-linux-gnu # - env: TARGET=mipsisa32r6el-unknown-linux-gnu # - env: TARGET=mipsisa64r6-unknown-linux-gnuabi64 # - env: TARGET=mipsisa64r6el-unknown-linux-gnuabi64 - Linux powerpc - Linux powerpc64le - Linux s390x # These got removed from cross, because they kept breaking: # https://github.com/rust-embedded/cross/pull/440 # - Linux powerpc64 # - Linux sparc64 # macOS - macOS aarch64 - macOS x86_64 # iOS - iOS aarch64 - iOS x86_64 # Android - Android i686 - Android x86_64 - Android arm - Android armv7 - Android aarch64 # *BSD # - i686-unknown-freebsd DISABLE_TESTS=1 # - x86_64-unknown-freebsd DISABLE_TESTS=1 - NetBSD x86_64 # Solaris # - Solaris x86_64 # weird error # https://travis-ci.org/LiveSplit/livesplit-core/jobs/327011754 # - env: TARGET=sparcv9-sun-solaris # Testing other channels - Windows Beta - Windows Nightly - Windows Beta gnu - Windows Nightly gnu - Linux Beta - Linux Nightly - macOS Beta - macOS Nightly include: # Bare Metal - label: Bare Metal Nvidia PTX 64 target: nvptx64-nvidia-cuda os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true - label: Bare Metal ARM Cortex-M thumbv6m target: thumbv6m-none-eabi os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true - label: Bare Metal ARM Cortex-M thumbv7em target: thumbv7em-none-eabi os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true - label: Bare Metal ARM Cortex-M thumbv7em Hardware Float target: thumbv7em-none-eabihf os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true - label: Bare Metal ARM Cortex-M thumbv7m target: thumbv7m-none-eabi os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true - label: Bare Metal ARM Cortex-M thumbv8m.base target: thumbv8m.base-none-eabi os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true - label: Bare Metal ARM Cortex-M thumbv8m.main target: thumbv8m.main-none-eabi os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true - label: Bare Metal ARM Cortex-M thumbv8m.main Hardware Float target: thumbv8m.main-none-eabihf os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true # - label: Bare Metal RISC-V 32 i # target: riscv32i-unknown-none-elf # os: ubuntu-latest # toolchain: stable # tests: skip # dylib: skip # release: skip # no_std: true # install_target: true # - label: Bare Metal RISC-V 32 imc # target: riscv32imc-unknown-none-elf # os: ubuntu-latest # toolchain: stable # tests: skip # dylib: skip # release: skip # no_std: true # install_target: true - label: Bare Metal RISC-V 32 imac target: riscv32imac-unknown-none-elf os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true - label: Bare Metal RISC-V 64 gc target: riscv64gc-unknown-none-elf os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true - label: Bare Metal RISC-V 64 imac target: riscv64imac-unknown-none-elf os: ubuntu-latest toolchain: stable tests: skip dylib: skip release: skip no_std: true install_target: true # WebAssembly - label: WebAssembly Unknown target: wasm32-unknown-unknown os: ubuntu-latest cross: skip tests: skip dylib: skip install_target: true - label: WebAssembly Web target: wasm32-unknown-unknown os: ubuntu-latest cross: skip tests: skip dylib: skip install_target: true features: "--features wasm-web" - label: WebAssembly WASI target: wasm32-wasi os: ubuntu-latest cross: skip dylib: skip install_target: true # Windows - label: Windows aarch64 target: aarch64-pc-windows-msvc os: windows-latest cross: skip tests: skip install_target: true # - label: Windows i586 # target: i586-pc-windows-msvc # os: windows-latest # cross: skip # auto_splitting: skip # install_target: true - label: Windows i686 target: i686-pc-windows-msvc os: windows-latest cross: skip auto_splitting: skip install_target: true - label: Windows x86_64 target: x86_64-pc-windows-msvc os: windows-latest cross: skip - label: Windows i686 gnu target: i686-pc-windows-gnu toolchain: stable-i686-pc-windows-gnu os: windows-latest cross: skip auto_splitting: skip networking: skip # Networking fails due to some linking error regarding -lntdll install_target: true - label: Windows x86_64 gnu target: x86_64-pc-windows-gnu toolchain: stable-x86_64-pc-windows-gnu os: windows-latest cross: skip install_target: true # Linux - label: Linux i586 target: i586-unknown-linux-gnu os: ubuntu-latest auto_splitting: skip - label: Linux i586 musl target: i586-unknown-linux-musl os: ubuntu-latest tests: skip dylib: skip - label: Linux i686 target: i686-unknown-linux-gnu os: ubuntu-latest auto_splitting: skip - label: Linux i686 musl target: i686-unknown-linux-musl os: ubuntu-latest auto_splitting: skip dylib: skip - label: Linux x86_64 target: x86_64-unknown-linux-gnu os: ubuntu-latest - label: Linux x86_64 musl target: x86_64-unknown-linux-musl os: ubuntu-latest dylib: skip - label: Linux x86_64 gnux32 target: x86_64-unknown-linux-gnux32 os: ubuntu-latest cross: skip install_target: true tests: skip dylib: skip - label: Linux arm target: arm-unknown-linux-gnueabi os: ubuntu-latest tests: skip - label: Linux arm musl target: arm-unknown-linux-musleabi os: ubuntu-latest tests: skip dylib: skip - label: Linux arm Hardware Float target: arm-unknown-linux-gnueabihf os: ubuntu-latest tests: skip dylib: skip - label: Linux arm musl Hardware Float target: arm-unknown-linux-musleabihf os: ubuntu-latest tests: skip dylib: skip - label: Linux armv5te target: armv5te-unknown-linux-gnueabi os: ubuntu-latest tests: skip dylib: skip - label: Linux armv5te musl target: armv5te-unknown-linux-musleabi os: ubuntu-latest tests: skip dylib: skip - label: Linux armv7 Hardware Float target: armv7-unknown-linux-gnueabihf os: ubuntu-latest auto_splitting: skip - label: Linux armv7 musl Hardware Float target: armv7-unknown-linux-musleabihf os: ubuntu-latest tests: skip dylib: skip - label: Linux aarch64 target: aarch64-unknown-linux-gnu os: ubuntu-latest - label: Linux mips target: mips-unknown-linux-gnu os: ubuntu-latest auto_splitting: skip networking: skip # FIXME: Networking Tests fail due to missing OpenSSL # https://github.com/LiveSplit/livesplit-core/issues/308 software_rendering: skip # TODO: The software rendering is apparently not working on big # endian platforms. Almost definitely caused by tiny-skia. This may # or may not be intentional. - label: Linux mips64 target: mips64-unknown-linux-gnuabi64 os: ubuntu-latest auto_splitting: skip networking: skip # FIXME: Networking Tests fail due to missing OpenSSL # https://github.com/LiveSplit/livesplit-core/issues/308 software_rendering: skip # TODO: The software rendering is apparently not working on big # endian platforms. Almost definitely caused by tiny-skia. This may # or may not be intentional. - label: Linux mips64el target: mips64el-unknown-linux-gnuabi64 os: ubuntu-latest auto_splitting: skip networking: skip # FIXME: Networking Tests fail due to missing OpenSSL # https://github.com/LiveSplit/livesplit-core/issues/308 - label: Linux mipsel target: mipsel-unknown-linux-gnu os: ubuntu-latest auto_splitting: skip networking: skip # FIXME: Networking Tests fail due to missing OpenSSL # https://github.com/LiveSplit/livesplit-core/issues/308 - label: Linux mipsel musl target: mipsel-unknown-linux-musl os: ubuntu-latest tests: skip dylib: skip - label: Linux powerpc target: powerpc-unknown-linux-gnu os: ubuntu-latest tests: skip - label: Linux powerpc64le target: powerpc64le-unknown-linux-gnu os: ubuntu-latest tests: skip - label: Linux s390x target: s390x-unknown-linux-gnu os: ubuntu-latest tests: skip # These got removed from cross # - label: Linux powerpc64 # target: powerpc64-unknown-linux-gnu # os: ubuntu-latest # tests: skip # # FIXME: Networking Tests fail due to missing OpenSSL # # https://github.com/LiveSplit/livesplit-core/issues/308 # - label: Linux sparc64 # target: sparc64-unknown-linux-gnu # os: ubuntu-latest # tests: skip # macOS - label: macOS aarch64 target: aarch64-apple-darwin os: macOS-latest cross: skip tests: skip install_target: true # FIXME: Switch OS to ARM macOS once GitHub Actions provides that, # use the toolchain instead of the target and run the tests. - label: macOS x86_64 target: x86_64-apple-darwin os: macOS-latest cross: skip # iOS - label: iOS aarch64 target: aarch64-apple-ios os: macOS-latest cross: skip dylib: skip tests: skip install_target: true - label: iOS x86_64 target: x86_64-apple-ios os: macOS-latest cross: skip dylib: skip tests: skip install_target: true # Android - label: Android i686 target: i686-linux-android os: ubuntu-latest tests: skip - label: Android x86_64 target: x86_64-linux-android os: ubuntu-latest tests: skip # The tests fail with an illegal instruction since 1.40 # https://github.com/rust-lang/rust/issues/67582 - label: Android arm target: arm-linux-androideabi os: ubuntu-latest tests: skip - label: Android armv7 target: armv7-linux-androideabi os: ubuntu-latest tests: skip - label: Android aarch64 target: aarch64-linux-android os: ubuntu-latest tests: skip # *BSD - label: NetBSD x86_64 target: x86_64-unknown-netbsd os: ubuntu-latest tests: skip # Solaris # - label: Solaris x86_64 # target: x86_64-sun-solaris # os: ubuntu-latest # tests: skip # dylib: skip # FIXME: Solaris stopped working. core isn't available: # https://github.com/LiveSplit/livesplit-core/runs/2777745289?check_suite_focus=true # Testing other channels - label: Windows Beta target: x86_64-pc-windows-msvc os: windows-latest toolchain: beta release: skip cross: skip - label: Windows Nightly target: x86_64-pc-windows-msvc os: windows-latest toolchain: nightly release: skip cross: skip - label: Windows Beta gnu target: x86_64-pc-windows-gnu toolchain: beta-x86_64-pc-windows-gnu release: skip os: windows-latest cross: skip install_target: true - label: Windows Nightly gnu target: x86_64-pc-windows-gnu toolchain: nightly-x86_64-pc-windows-gnu release: skip os: windows-latest cross: skip install_target: true - label: Linux Beta target: x86_64-unknown-linux-gnu os: ubuntu-latest toolchain: beta release: skip - label: Linux Nightly target: x86_64-unknown-linux-gnu os: ubuntu-latest toolchain: nightly release: skip - label: macOS Beta target: x86_64-apple-darwin os: macOS-latest toolchain: beta release: skip cross: skip - label: macOS Nightly target: x86_64-apple-darwin os: macOS-latest toolchain: nightly release: skip cross: skip steps: - name: Checkout Commit uses: actions/checkout@v2 - name: Install Rust uses: hecrj/setup-rust-action@v1 with: rust-version: ${{ matrix.toolchain || 'stable' }} - name: Install Target if: matrix.install_target != '' run: rustup target add ${{ matrix.target }} - name: Install cross if: matrix.cross == '' && matrix.no_std == '' run: cargo install cross - name: Build Static Library run: sh .github/workflows/build_static.sh env: TARGET: ${{ matrix.target }} SKIP_CROSS: ${{ matrix.cross }} IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }} FEATURES: ${{ matrix.features }} NO_STD: ${{ matrix.no_std }} - name: Build Shared Library if: matrix.dylib == '' run: sh .github/workflows/build_shared.sh env: TARGET: ${{ matrix.target }} SKIP_CROSS: ${{ matrix.cross }} IS_DEPLOY: ${{ startsWith(github.ref, 'refs/tags/') && (matrix.release_anyway != '' || !(startsWith(matrix.toolchain, 'nightly') || startsWith(matrix.toolchain, 'beta'))) }} FEATURES: ${{ matrix.features }} - name: Test if: matrix.tests == '' run: sh .github/workflows/test.sh env: TARGET: ${{ matrix.target }} SKIP_CROSS: ${{ matrix.cross }} SKIP_AUTO_SPLITTING: ${{ matrix.auto_splitting }} SKIP_NETWORKING: ${{ matrix.networking }} SKIP_SOFTWARE_RENDERING: ${{ matrix.software_rendering }} - name: Prepare Release if: startsWith(github.ref, 'refs/tags/') && matrix.release == '' shell: bash run: .github/workflows/before_deploy.sh env: OS_NAME: ${{ matrix.os }} TARGET: ${{ matrix.target }} - name: Release if: startsWith(github.ref, 'refs/tags/') && matrix.release == '' uses: softprops/action-gh-release@v1 with: files: livesplit-core-*.* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} bind_gen: name: Generate bindings runs-on: ubuntu-latest steps: - name: Checkout Commit uses: actions/checkout@v2 - name: Install Rust uses: hecrj/setup-rust-action@v1 - name: Generate bindings run: | cd capi/bind_gen cargo run cd ../.. clippy: name: Check clippy lints runs-on: ubuntu-latest steps: - name: Checkout Commit uses: actions/checkout@v2 - name: Install Rust uses: hecrj/setup-rust-action@v1 with: components: clippy - name: Run Clippy run: cargo clippy --all-features format: name: Check formatting runs-on: ubuntu-latest steps: - name: Checkout Commit uses: actions/checkout@v2 - name: Install Rust uses: hecrj/setup-rust-action@v1 with: components: rustfmt - name: Run cargo fmt run: cargo fmt -- --check || true bench: name: Run benchmarks runs-on: ubuntu-latest env: CRITERION_TOKEN: ${{ secrets.CRITERION_TOKEN }} steps: - name: Checkout uses: actions/checkout@v2 - name: Install Rust uses: hecrj/setup-rust-action@v1 - name: Run benchmarks run: | # run benchmarks and save baseline to "criterion.dev.temp" cargo bench --all-features -- --verbose --noplot --save-baseline criterion.dev.temp # # set the path to the file to upload to criterion.dev # echo "CRITERION_FILE_PATH=$(find ./target/criterion/ -name raw.csv)" >> $GITHUB_ENV # - name: Upload benchmarks # run: | # # upload the file # curl -F 'raw.csv=@${{ env.CRITERION_FILE_PATH }}' \ # 'https://api.criterion.dev/v1/${{ github.repository }}/measurements?token=${{ secrets.CRITERION_TOKEN }}&commit=${{ github.sha }}' docs: name: Generate documentation if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - uses: actions/checkout@master - name: Use Node 10 uses: actions/setup-node@v1 with: node-version: '10.x' - name: Build TypeScript documentation run: | cd capi/js make docs cd ../.. - name: Upload documentation files run: | git config --global user.email "action@github.com" git config --global user.name "GitHub Action" git clone -q "https://github.com/LiveSplit/livesplit-core-docs" cd livesplit-core-docs rm -r * mv ../docs/* . git add . git commit --amend -m "Update documentation" git push --force https://action:${{ secrets.LIVESPLIT_CORE_DOCS_UPLOAD }}@github.com/LiveSplit/livesplit-core-docs.git