Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Basic Rust testing + merge commit detection with Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mbestavros committed Nov 26, 2019
1 parent a7f5635 commit 3177227
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/enarx-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Enarx Standard Tests
# Automated testing common to all Enarx repositories.

on: [push, pull_request]

jobs:
commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.head_ref }}
# Ensure pull requests do not contain merge commits.
- name: No merge commits
# Merge commits have two parent commits. This command iterates through
# all commits added by the PR (everything since the base ref) and fails
# if it finds multiple parents. If all commits only have one, it exits
# successfully.
run: git rev-list origin/${{ github.base_ref }}.. | xargs -n1 -I{} sh -c '! git rev-parse {}^2'
25 changes: 25 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Enarx Rust Tests
# Automated testing specific to Enarx's Rust repositories.

on: [pull_request]

jobs:
# Ensure all code is properly formatted with `rustfmt`.
rust-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: rustfmt
run: cargo fmt -- --check

# Build and test the crate.
rust-build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# Ensure the project builds correctly.
- name: Build
run: cargo build --verbose
# Run any specified Rust tests.
- name: Run tests
run: cargo test --verbose

0 comments on commit 3177227

Please sign in to comment.