ruffle/.github/workflows/test_rust.yml

76 lines
1.9 KiB
YAML
Raw Normal View History

name: Test Rust
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
2021-02-20 18:10:04 +00:00
name: Test Rust ${{ matrix.rust_version }} / ${{ matrix.os.name }}
runs-on: ${{ matrix.os.name }}
continue-on-error: ${{ matrix.rust_version == 'nightly' }}
strategy:
fail-fast: false
matrix:
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 }
]
steps:
- 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'
run: |
2021-02-20 18:10:04 +00:00
sudo add-apt-repository ppa:kisak/kisak-mesa -y
sudo apt-get update
2021-02-20 18:10:04 +00:00
sudo apt-get dist-upgrade
sudo apt install -y libasound2-dev libxcb-shape0-dev libxcb-xfixes0-dev mesa-vulkan-drivers
2021-02-20 18:10:04 +00:00
- name: Run tests with image tests
if: ${{ matrix.os.img_tests }}
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
- 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