Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds github action for CI. (#11) #12

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
10 changes: 10 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
project:
default:
target: 80%
threshold: 5%
patch:
default:
target: 85%
threshold: 5%
47 changes: 47 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Code Coverage

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:
os: [ubuntu-latest]

steps:
- name: Git Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Rust Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
# nightly can be very volatile--pin this to a version we know works well...
toolchain: nightly-2021-06-12
override: true
- name: Cargo Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --workspace --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
# https://github.com/marketplace/actions/rust-grcov
# For some reason the panic=abort modes don't work for build script...
#RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
#RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off'
- id: coverage
name: Code Coverage
uses: actions-rs/grcov@v0.1
- name: Codecov Upload
uses: codecov/codecov-action@v1
with:
files: ${{ steps.coverage.outputs.report }}
47 changes: 47 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Remove MSys64 MingW64 Binaries
if: runner.os == 'Windows'
run: Remove-Item -LiteralPath "C:\msys64\mingw64\bin" -Force -Recurse
- name: Install Dependencies
if: runner.os == 'Windows'
run: choco install llvm -y
- 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
- name: Rustfmt Check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --verbose -- --check