-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #817 from philipcraig/github-actions
github actions build and test on major architectures
- Loading branch information
Showing
14 changed files
with
203 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
schedule: [cron: "40 1 * * *"] | ||
|
||
jobs: | ||
test: | ||
name: ${{matrix.name || format('Rust {0}', matrix.rust)}}-test | ||
runs-on: ${{matrix.os || 'ubuntu'}}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- rust: nightly | ||
- rust: beta | ||
- rust: stable | ||
- name: macOS | ||
rust: nightly | ||
os: macos | ||
- name: Windows (gnu) | ||
rust: nightly-x86_64-pc-windows-gnu | ||
os: windows | ||
- name: Windows (msvc) | ||
rust: nightly-x86_64-pc-windows-msvc | ||
os: windows | ||
flags: /EHsc | ||
env: | ||
CARGO_TERM_COLOR: always | ||
CXXFLAGS: ${{matrix.flags}} | ||
RUSTFLAGS: --cfg deny_warnings -Dwarnings | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{matrix.rust}} | ||
components: rustfmt | ||
# For operating systems that have it packaged, install creduce | ||
- name: Install creduce (Linux) | ||
if: matrix.os == '' | ||
run: sudo apt-get install creduce | ||
- name: Install creduce (MacOS) | ||
if: matrix.os == 'macOS' | ||
run: brew install creduce | ||
- name: Set LIBCLANG_PATH (Windows) | ||
# Windows github action doesn't set the path for clang, so set it | ||
# See https://github.com/rust-lang/rust-bindgen/issues/1797 | ||
if: matrix.os == 'windows' | ||
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV | ||
- name: Exclude failing targets and tests | ||
# no creduce on Windows, so exclude tests needing creduce there | ||
run: | | ||
echo RUSTFLAGS=$RUSTFLAGS >> $GITHUB_ENV | ||
echo ::set-output name=exclude::${{runner.os == 'Windows' && '--exclude autocxx-reduce --exclude autocxx-gen' || ''}} | ||
env: | ||
# non-linux failures https://github.com/google/autocxx/issues/819 | ||
# beta failing tests https://github.com/google/autocxx/issues/818 | ||
RUSTFLAGS: ${{matrix.name == 'Windows (msvc)' && '--cfg skip_windows_msvc_failing_tests' || ''}} ${{matrix.name == 'Windows (gnu)' && '--cfg skip_windows_gnu_failing_tests' || ''}} ${{matrix.rust == 'beta' && '--cfg skip_beta_failing_tests' || ''}} | ||
id: testsuite | ||
shell: bash | ||
- run: cargo test --workspace ${{steps.testsuite.outputs.exclude}} | ||
|
||
examples: | ||
name: ${{matrix.name || format('Rust {0}', matrix.rust)}}-examples | ||
runs-on: ${{matrix.os || 'ubuntu'}}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- rust: nightly | ||
- rust: beta | ||
- rust: stable | ||
- name: macOS | ||
rust: nightly | ||
os: macos | ||
- name: Windows (gnu) | ||
rust: nightly-x86_64-pc-windows-gnu | ||
os: windows | ||
- name: Windows (msvc) | ||
rust: nightly-x86_64-pc-windows-msvc | ||
os: windows | ||
flags: /EHsc | ||
env: | ||
CARGO_TERM_COLOR: always | ||
CXXFLAGS: ${{matrix.flags}} | ||
RUSTFLAGS: --cfg deny_warnings -Dwarnings | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{matrix.rust}} | ||
components: rustfmt | ||
- name: Set LIBCLANG_PATH (Windows) | ||
# Windows github action doesn't set the path for clang, so set it | ||
# See https://github.com/rust-lang/rust-bindgen/issues/1797 | ||
if: matrix.os == 'windows' | ||
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV | ||
- name: Build s2 example | ||
working-directory: ./examples/s2 | ||
# s2 doesn't link on Windows | ||
if: matrix.os != 'windows' | ||
run: cargo build | ||
- name: Build steam example | ||
working-directory: ./examples/steam-mini | ||
run: cargo build | ||
- name: Build subclass example | ||
working-directory: ./examples/subclass | ||
run: cargo build | ||
- name: Build pod example | ||
working-directory: ./examples/pod | ||
run: cargo build | ||
- name: Build chromium render-frame-host example | ||
working-directory: ./examples/chromium-fake-render-frame-host | ||
# chromium-fake-render-frame-host doesn't link on Windows | ||
if: matrix.os != 'windows' | ||
run: cargo build | ||
- name: Build non-trivial-type-on-stack example | ||
working-directory: ./examples/non-trivial-type-on-stack | ||
run: cargo build | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_TERM_COLOR: always | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dtolnay/rust-toolchain@clippy | ||
- run: cargo clippy --workspace --tests -- -Dclippy::all | ||
|
||
outdated: | ||
name: Outdated | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_TERM_COLOR: always | ||
if: github.event_name != 'pull_request' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dtolnay/install@cargo-outdated | ||
- run: cargo outdated --exit-code 1 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.