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

Add integration tests #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,51 @@ jobs:
override: true
- name: Run the tests
run: cargo test -- --nocapture
setup-integration-test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build the release
run: cargo build --release
- name: Upload tfb_toolset for integration tests
uses: actions/upload-artifact@v2
with:
name: tfb_toolset
path: target/release/tfb_toolset
- id: verify_out
name: Write integration test job matrix
run: |
# Use of jq for JSON array creation from https://stackoverflow.com/a/26809318
# The following creates a JSON array populated by the lang directories
# with a TESTLANG object in the include array for each language under test/frameworks
VERIFY_MATRIX=$(ls -1 test/frameworks | jq -R | jq -sc "{include: map({TESTLANG: .})}")
echo "::set-output name=verify_matrix::$VERIFY_MATRIX"
outputs:
verify_matrix: ${{ steps.verify_out.outputs.verify_matrix }}
integration-test:
runs-on: ubuntu-20.04
needs: setup-integration-test
strategy:
matrix: ${{ fromJSON(needs.setup-integration-test.outputs.verify_matrix) }}
# Disable fail-fast to allow all failing frameworks/etc to fail in a
# single build, rather than stopping when the first one fails.
fail-fast: false
env:
TESTLANG: ${{ matrix.TESTLANG }}
steps:
- uses: actions/checkout@v2
- name: Download tfb_toolset
uses: actions/download-artifact@v2
with:
name: tfb_toolset
path: .
- name: Run the tests
run: |
sudo chmod +x ./tfb_toolset
./tfb_toolset --mode cicd --test-lang $TESTLANG --results-environment Github-Actions;