bevy/.github/workflows/ci.yml

131 lines
3.9 KiB
YAML
Raw Normal View History

name: CI
2020-05-29 03:48:18 +00:00
on:
pull_request:
push:
branches: [main, staging, trying]
2020-05-29 03:48:18 +00:00
env:
CARGO_TERM_COLOR: always
jobs:
build:
2020-08-26 18:57:35 +00:00
strategy:
matrix:
toolchain: [stable, nightly]
os: [windows-latest, ubuntu-latest, macos-latest]
2020-09-03 01:10:42 +00:00
exclude:
- os: macos-latest
2020-09-03 01:10:42 +00:00
toolchain: nightly
- os: windows-latest
toolchain: nightly
runs-on: ${{ matrix.os }}
2020-05-29 03:48:18 +00:00
steps:
2020-05-29 05:44:04 +00:00
- uses: actions/checkout@v2
2020-08-16 03:27:41 +00:00
2020-06-08 08:05:56 +00:00
- uses: actions-rs/toolchain@v1
with:
2020-08-26 18:57:35 +00:00
toolchain: ${{ matrix.toolchain }}
components: rustfmt, clippy
2020-06-08 08:05:56 +00:00
override: true
2020-08-16 03:27:41 +00:00
- name: Install alsa and udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
if: runner.os == 'linux'
2020-08-16 03:27:41 +00:00
- name: Check the format
# See tools/ci/src/main.rs for the commands this runs
Silence annoying rustfmt config warnings (#1508) Silence those [annoying rustfmt config warnings](https://github.com/bevyengine/bevy/pull/1499/checks?check_run_id=1950282111#step:5:66) that happen because we have unstable rustfmt options in `rustfmt.toml`, but we run it in stable on CI. Thanks to @Ratysz for [calling it out](https://github.com/bevyengine/bevy/pull/1499#issuecomment-783190586). 😄 The final approach we settled on was to comment out the unstable options in `rustfmt.toml`. Those who are using `nightly` may uncomment the unstable options locally if they wish. Once the options stabilize, we can uncomment them again. We also decided that instead of fixing the alias, we would remove the alias entirely so that we do not introduce a custom `.cargo/config.toml` that would conflict with users' custom version of the same file. This means that instead of using a `cargo ci` alias you should use `cargo run -p ci` or `cargo run --package ci` instead. <details><summary>Original Approach (abandoned)</summary> <p> _We decided **not** to go this way..._ In my quest to find a portable way to filter out the warnings I switched the library used to execute commands from `xshell` to `duct` (as advised by the `xshell` project itself when you want to do less simple things). This still uses the "xtask" pattern of using a cargo command alias and a rust project for what would have usually been done with a bash script (on posix), just a different helper library is being used internally. NOTE 1: Also, thanks to some sleuthing by @DJMcNab we were able to fix the broken cargo alias. The issue turned out to be that `.cargo/config.toml` was being ignored because of `.gitignore`. NOTE 2: This is a [known breaking change](https://github.com/bevyengine/bevy/pull/1309#discussion_r564023753) for anyone working on bevy who has their own local `.cargo/config.toml`. </p> </details>
2021-03-07 19:50:17 +00:00
run: cargo run -p ci
if: runner.os == 'linux' && matrix.toolchain == 'stable'
2020-08-26 18:57:35 +00:00
- name: Build & run tests
2020-08-26 18:57:35 +00:00
run: cargo test --workspace
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
build-wasm:
strategy:
matrix:
toolchain: [stable, nightly]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: wasm32-unknown-unknown
override: true
- name: Check wasm
uses: actions-rs/cargo@v1
with:
command: check
args: --target wasm32-unknown-unknown --no-default-features --features bevy_winit,x11,hdr,bevy_gltf
build-android:
2020-08-26 18:57:35 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Android targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi
- name: Install Cargo APK
run: cargo install cargo-apk
- name: Build APK
run: cargo apk build --example android
Cleanup of Markdown Files and add CI Checking (#1463) I have run the VSCode Extension [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) on all Markdown Files in the Repo. The provided Rules are documented here: https://github.com/DavidAnson/markdownlint/blob/v0.23.1/doc/Rules.md Rules I didn't follow/fix: * MD024/no-duplicate-heading * Changelog: Here Heading will always repeat. * Examples Readme: Platform-specific documentation should be symmetrical. * MD025/single-title * MD026/no-trailing-punctuation * Caused by the ! in "Hello, World!". * MD033/no-inline-html * The plugins_guidlines file does need HTML, so the shown badges aren't downscaled too much. * ~~MD036/no-emphasis-as-heading:~~ * ~~This Warning only Appears in the Github Issue Templates and can be ignored.~~ * ~~MD041/first-line-heading~~ * ~~Only appears in the Readme for the AlienCake example Assets, which is unimportant.~~ --- I also sorted the Examples in the Readme and Cargo.toml in this order/Priority: * Topic/Folder * Introductionary Examples * Alphabetical Order The explanation for each case, where it isn't Alphabetical : * Diagnostics * log_diagnostics: The usage of inbuild Diagnostics is more important than creating your own. * ECS (Entity Component System) * ecs_guide: The guide should be read, before diving into other Features. * Reflection * reflection: Basic Explanation should be read, before more advanced Topics. * WASM Examples * hello_wasm: It's "Hello, World!".
2021-02-22 04:50:05 +00:00
markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Run Markdown Lint
Bump github/super-linter from v3.15.2 to v3.15.5 (#1783) Bumps [github/super-linter](https://github.com/github/super-linter) from v3.15.2 to v3.15.5. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/github/super-linter/releases">github/super-linter's releases</a>.</em></p> <blockquote> <h2>Release v3.15.5</h2> <p>No release notes provided.</p> <h2>Release v3.15.3</h2> <h2>Changelog</h2> <ul> <li>Updated Deployment scripts</li> <li>Updated Security Scripts</li> <li>Support <code>.env.*</code> for various <code>.env</code> files</li> </ul> <h2>Bugs</h2> <ul> <li>Various security bumps</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/github/super-linter/commit/286abe2b0349da9c074c0fed8e8ec0a86cd13279"><code>286abe2</code></a> Updating action.yml with new release version</li> <li><a href="https://github.com/github/super-linter/commit/1d0751b749663e61a6baa2ff86ae8e957b6ecbae"><code>1d0751b</code></a> cleanup (<a href="https://github-redirect.dependabot.com/github/super-linter/issues/1378">#1378</a>)</li> <li><a href="https://github.com/github/super-linter/commit/be0e288e1eb8b6295c661692c95d6b912907334e"><code>be0e288</code></a> Bump cljkondo/clj-kondo from 2021.03.03-alpine to 2021.03.22-alpine (<a href="https://github-redirect.dependabot.com/github/super-linter/issues/1379">#1379</a>)</li> <li><a href="https://github.com/github/super-linter/commit/8ff48a47d3446575d60ecde8df1e4b2f866bfaa2"><code>8ff48a4</code></a> Bump isort from 5.7.0 to 5.8.0 in /dependencies (<a href="https://github-redirect.dependabot.com/github/super-linter/issues/1382">#1382</a>)</li> <li><a href="https://github.com/github/super-linter/commit/55cc19dbbcb5fbb4d270bdddbd567ee9c7fe6413"><code>55cc19d</code></a> Bump immer from 8.0.3 to 9.0.1 in /dependencies (<a href="https://github-redirect.dependabot.com/github/super-linter/issues/1381">#1381</a>)</li> <li><a href="https://github.com/github/super-linter/commit/a68b522bc18d1df3ef7f8604b01f73cb2fe22bd1"><code>a68b522</code></a> Bump sql-lint from 0.0.15 to 0.0.16 in /dependencies (<a href="https://github-redirect.dependabot.com/github/super-linter/issues/1380">#1380</a>)</li> <li><a href="https://github.com/github/super-linter/commit/701fd3b339ccf0b81596950adba6306c6e4164f0"><code>701fd3b</code></a> Adding a11y eslint to npm dependencies (<a href="https://github-redirect.dependabot.com/github/super-linter/issues/1375">#1375</a>)</li> <li><a href="https://github.com/github/super-linter/commit/4016de6222c95f0175927d6a0bbe06e87f33bddb"><code>4016de6</code></a> Bump immer from 8.0.2 to 8.0.3 in /dependencies (<a href="https://github-redirect.dependabot.com/github/super-linter/issues/1376">#1376</a>)</li> <li><a href="https://github.com/github/super-linter/commit/43e054faf75478c49505b382dd972c2c6b18cb05"><code>43e054f</code></a> Bump immer from 8.0.1 to 8.0.2 in /dependencies (<a href="https://github-redirect.dependabot.com/github/super-linter/issues/1374">#1374</a>)</li> <li><a href="https://github.com/github/super-linter/commit/46d76783c7c682ed91137e01cf91c556016bec56"><code>46d7678</code></a> Bump eslint-plugin-jest from 24.3.1 to 24.3.2 in /dependencies (<a href="https://github-redirect.dependabot.com/github/super-linter/issues/1372">#1372</a>)</li> <li>Additional commits viewable in <a href="https://github.com/github/super-linter/compare/v3.15.2...286abe2b0349da9c074c0fed8e8ec0a86cd13279">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details>
2021-04-13 02:56:29 +00:00
uses: github/super-linter@v3.15.5
Cleanup of Markdown Files and add CI Checking (#1463) I have run the VSCode Extension [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint) on all Markdown Files in the Repo. The provided Rules are documented here: https://github.com/DavidAnson/markdownlint/blob/v0.23.1/doc/Rules.md Rules I didn't follow/fix: * MD024/no-duplicate-heading * Changelog: Here Heading will always repeat. * Examples Readme: Platform-specific documentation should be symmetrical. * MD025/single-title * MD026/no-trailing-punctuation * Caused by the ! in "Hello, World!". * MD033/no-inline-html * The plugins_guidlines file does need HTML, so the shown badges aren't downscaled too much. * ~~MD036/no-emphasis-as-heading:~~ * ~~This Warning only Appears in the Github Issue Templates and can be ignored.~~ * ~~MD041/first-line-heading~~ * ~~Only appears in the Readme for the AlienCake example Assets, which is unimportant.~~ --- I also sorted the Examples in the Readme and Cargo.toml in this order/Priority: * Topic/Folder * Introductionary Examples * Alphabetical Order The explanation for each case, where it isn't Alphabetical : * Diagnostics * log_diagnostics: The usage of inbuild Diagnostics is more important than creating your own. * ECS (Entity Component System) * ecs_guide: The guide should be read, before diving into other Features. * Reflection * reflection: Basic Explanation should be read, before more advanced Topics. * WASM Examples * hello_wasm: It's "Hello, World!".
2021-02-22 04:50:05 +00:00
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: true
DEFAULT_BRANCH: master
# Not needed here as only one Linter is used.
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run-examples:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo apt-get update;
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq \
libasound2-dev libudev-dev wget unzip xvfb;
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup swiftshader
run: |
wget https://github.com/qarmin/gtk_library_store/releases/download/3.24.0/swiftshader.zip;
unzip swiftshader.zip;
curr="$(pwd)/libvk_swiftshader.so";
sed -i "s|PATH_TO_CHANGE|$curr|" vk_swiftshader_icd.json;
- name: Build bevy
run: |
cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_wgpu,bevy_winit,render,png,hdr,x11,bevy_ci_testing"
- name: Run examples
run: |
for example in .github/example-run/*.ron; do
example_name=`basename $example .ron`
echo "running $example_name - "`date`
time CI_TESTING_CONFIG=$example VK_ICD_FILENAMES=$(pwd)/vk_swiftshader_icd.json DRI_PRIME=0 xvfb-run cargo run --example $example_name --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_wgpu,bevy_winit,render,png,hdr,x11,bevy_ci_testing"
sleep 10
done