2020-05-18 08:56:05 +00:00
|
|
|
name: Test Rust
|
2020-05-09 12:59:27 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-05-08 02:30:56 +00:00
|
|
|
branches: [master]
|
2020-05-09 12:59:27 +00:00
|
|
|
pull_request:
|
2021-05-08 02:30:56 +00:00
|
|
|
branches: [master]
|
2020-05-09 12:59:27 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-02-20 18:10:04 +00:00
|
|
|
name: Test Rust ${{ matrix.rust_version }} / ${{ matrix.os.name }}
|
|
|
|
runs-on: ${{ matrix.os.name }}
|
2020-05-09 12:59:27 +00:00
|
|
|
continue-on-error: ${{ matrix.rust_version == 'nightly' }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2021-05-08 02:30:56 +00:00
|
|
|
rust_version: ["stable", "beta", "nightly"]
|
2021-02-20 18:10:04 +00:00
|
|
|
os: [
|
|
|
|
{name: ubuntu-latest, img_tests: true },
|
|
|
|
{name: windows-latest, img_tests: true },
|
|
|
|
{name: macOS-latest, img_tests: false }
|
|
|
|
]
|
2020-05-09 12:59:27 +00:00
|
|
|
|
|
|
|
steps:
|
2021-05-08 02:30:56 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: ${{ matrix.rust_version }}
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
|
|
|
- name: Install Linux dependencies
|
2021-02-20 18:10:04 +00:00
|
|
|
if: matrix.os.name == 'ubuntu-latest'
|
2021-05-08 02:30:56 +00:00
|
|
|
run: |
|
2021-02-20 18:10:04 +00:00
|
|
|
sudo add-apt-repository ppa:kisak/kisak-mesa -y
|
2021-05-08 02:30:56 +00:00
|
|
|
sudo apt-get update
|
2021-02-20 18:10:04 +00:00
|
|
|
sudo apt-get dist-upgrade
|
2021-07-31 07:07:02 +00:00
|
|
|
sudo apt install -y libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev mesa-vulkan-drivers
|
2021-05-08 02:30:56 +00:00
|
|
|
|
2021-02-20 18:10:04 +00:00
|
|
|
- name: Run tests with image tests
|
|
|
|
if: ${{ matrix.os.img_tests }}
|
2021-05-08 02:30:56 +00:00
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
2021-02-20 18:10:04 +00:00
|
|
|
args: --features imgtests
|
|
|
|
|
|
|
|
- name: Run tests without image tests
|
|
|
|
if: ${{ !matrix.os.img_tests }}
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: test
|
|
|
|
|
|
|
|
|
|
|
|
- name: Upload images
|
|
|
|
if: ${{ failure() }}
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: swf_images
|
|
|
|
path: tests/**/*.png.updated
|
2021-05-08 02:30:56 +00:00
|
|
|
|
|
|
|
- name: Check clippy
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: clippy
|
|
|
|
args: --all --tests -- -D warnings
|
|
|
|
|
|
|
|
- name: Check formatting
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
|
|
|
args: --all -- --check
|
2021-02-20 18:10:04 +00:00
|
|
|
|