Skip to content

Commit

Permalink
Add CLI driver tests and build workflow (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
camerondurham committed Mar 7, 2022
1 parent 295921f commit a1378f7
Show file tree
Hide file tree
Showing 4 changed files with 353 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI Build

on: [push, pull_request]

jobs:
build:
name: Build and Test
runs-on: ${{ matrix.os }}
# We want to run on external PRs, but not on internal ones as push automatically builds
# H/T: https://github.com/Dart-Code/Dart-Code/commit/612732d5879730608baa9622bf7f5e5b7b51ae65
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'amzn/ion-cli'
strategy:
matrix:
# TODO: add windows after fixing cmake version error issues
# see for example Windows build workflow: https://github.com/amzn/ion-rust/blob/a4b154cc0a5b5b661a45ac14d3719a501573d8f2/.github/workflows/rust.yml#L13-L28
os: [ubuntu-latest, macos-latest]

steps:
- name: Git Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cargo Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --workspace
- name: Cargo Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --workspace -- --test-threads=1
# TODO: run rustfmt and enable check
# - name: Rustfmt Check
# uses: actions-rs/cargo@v1
# with:
# command: fmt
# args: --verbose -- --check
157 changes: 157 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ ion-schema = "0.1.0"
[build-dependencies]
cmake = "0.1.44"

[dev-dependencies]
rstest = "~0.10.0"
assert_cmd = "~1.0.5"
tempfile = "~3.2.0"

[[bin]]
name = "ion"
test = false
test = true
bench = false
Loading

0 comments on commit a1378f7

Please sign in to comment.