Change CI to GitHub Actions

This commit is contained in:
Sean McArthur
2019-12-02 14:35:30 -08:00
parent 579f778f8f
commit 33129e8888
5 changed files with 30 additions and 67 deletions
+30
View File
@@ -0,0 +1,30 @@
name: CI
on: [push, pull_request]
jobs:
style:
name: Check Style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rustfmt
run: rustup component add rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
test:
name: Test
needs: [style]
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@master
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- name: Run tests
run: cargo test
-13
View File
@@ -1,13 +0,0 @@
trigger: ["master"]
pr: ["master"]
jobs:
# Check formatting
- job: rustfmt
pool:
vmImage: ubuntu-16.04
steps:
- template: ci/azure-rustfmt.yml
# Run tests
- template: ci/azure-test-all.yml
-25
View File
@@ -1,25 +0,0 @@
steps:
# Linux and macOS.
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
env:
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
displayName: "Install rust (*nix)"
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
# Windows.
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
env:
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
displayName: "Install rust (windows)"
condition: eq(variables['Agent.OS'], 'Windows_NT')
# All platforms.
- script: |
rustc -Vv
cargo -V
displayName: Query rust and cargo versions
-10
View File
@@ -1,10 +0,0 @@
steps:
- template: azure-install-rust.yml
parameters:
rust_version: stable
- bash: |
rustup component add rustfmt
displayName: Install rustfmt
- bash: |
cargo fmt --all -- --check
displayName: Check formatting
-19
View File
@@ -1,19 +0,0 @@
jobs:
- job: cargo_test_all
displayName: cargo test
pool:
vmImage: ubuntu-16.04
strategy:
matrix:
stable:
rust_version: stable
beta:
rust_version: beta
nightly:
rust_version: nightly
steps:
- template: azure-install-rust.yml
parameters:
rust_version: $(rust_version)
- script: cargo test
displayName: cargo test