Migrate to Github actions (fix #56) (#66)

This commit is contained in:
Roey Darwish Dror 2020-12-03 22:09:18 +02:00 committed by Philip Mueller
parent f594fc2ffc
commit 67f7266ef9
2 changed files with 38 additions and 37 deletions

38
.github/workflows/rust.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1.0.1
name: Check format
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1.0.1
name: Run clippy
with:
command: clippy
args: --all-targets --locked -- -D warnings
- uses: actions-rs/cargo@v1.0.1
name: Run tests
with:
command: test

View File

@ -1,37 +0,0 @@
stages:
- stage: Check
jobs:
- job: Check
displayName: Sanity Check
pool:
vmImage: 'ubuntu-16.04'
container: 'rust:latest'
steps:
- script: rustup component add clippy rustfmt
displayName: Install clippy and rustfmt
- script: cargo fmt -- --check
displayName: Check Formatting
- script: cargo check --all
displayName: Check
- script: cargo clippy
displayName: Clippy
- stage: Build
jobs:
- job: BuildDocker
displayName: Build Docker Image
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: Docker@2
displayName: Login to Dockerhub
inputs:
command: login
containerRegistry: Dockerhub
- task: Docker@2
displayName: Build and Push
inputs:
command: buildAndPush
repository: darwish/alma
tags: |
latest