feat: add .github/workflows/ #1
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
name: Rust Test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Rust | |
uses: actions/setup-rust@v1 | |
with: | |
rust-version: 'stable' | |
- name: Run tests | |
run: cargo test | |
- name: Check if tests passed | |
run: | | |
test_exit_code=$? | |
if [ $test_exit_code -eq 0 ]; then | |
echo "Tests passed!" | |
else | |
echo "Tests failed!" | |
exit $test_exit_code | |
fi |