Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b3c9a71
First try of setting a workflow for build and test
TheRustifyer Oct 25, 2022
57d8f14
Added ./canyon_sql as the working directory for the jobs steps
TheRustifyer Oct 25, 2022
dcc1f91
rust 2021 version for crates
TheRustifyer Oct 25, 2022
4a09209
Action will run tests and build for the three major OS
TheRustifyer Oct 26, 2022
da8dec9
Workflow only run tests now on the three major OS, not test and build
TheRustifyer Oct 26, 2022
a38b00d
Renamed the jobs of the tests workflow
TheRustifyer Oct 26, 2022
39a5968
First try of impl code coverage with gcov
TheRustifyer Oct 26, 2022
1b5a157
Working directory for the gcov action
TheRustifyer Oct 26, 2022
6ebb59e
Setting up defaults for the gcov job
TheRustifyer Oct 26, 2022
a725698
Defaults on runs-on
TheRustifyer Oct 26, 2022
fa496d2
Experimenting with jobs and run commands
TheRustifyer Oct 26, 2022
ec252d0
Added config path for the codecov action. Deleted --verbose flag from…
TheRustifyer Oct 26, 2022
61a64f7
Merge remote-tracking branch 'upstream/main' into GH-16-generate-a-te…
TheRustifyer Oct 26, 2022
d8ae84d
[REFACTOR] - The library is now handled from the root thanks to the C…
TheRustifyer Oct 26, 2022
602fd7d
Trying to export xml results from gcov to the output result
TheRustifyer Oct 26, 2022
548ec65
Specific config file for gcov config
TheRustifyer Oct 27, 2022
af792b9
Deleting the current workspace for canyon_sql taking advantage of the…
TheRustifyer Oct 27, 2022
e75de08
If always() for debug directories
TheRustifyer Oct 27, 2022
d3edd03
Setting up for merge
TheRustifyer Oct 29, 2022
6f605d7
Merge branch 'main' into GH-16-generate-a-testing-+-code-coverage-act…
TheRustifyer Oct 29, 2022
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
35 changes: 35 additions & 0 deletions .github/workflows/cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Caching Cargo events

on: push

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache Cargo
id: cache-cargo
uses: actions/cache@v3
env:
cache-name: cache-cargo
with:
path: cache-folder
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- if: ${{ steps.cache-cargo.outputs.cache-hit != 'true' }}
name: Install grcov
continue-on-error: true
run: cargo install grcov

- name: Build
run: cargo build

- name: Test
run: cargo test

# TODO we need to pass the OS flags correctly
37 changes: 37 additions & 0 deletions .github/workflows/publish-tests-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Unit Test Results

on:
workflow_run:
workflows: ["gcov"]
types:
- completed

jobs:
unit-test-results:
name: Unit Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'

steps:
- name: Download and Extract Artifacts
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
mkdir -p artifacts && cd artifacts

artifacts_url=${{ github.event.workflow_run.artifacts_url }}

gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
do
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
unzip -d "$name" "$name.zip"
done

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/*.xml"
135 changes: 59 additions & 76 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,82 +10,65 @@ env:
CARGO_TERM_COLOR: always

jobs:
# tests-unix:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run tests Unix
# working-directory: ./canyon_sql
# run: cargo test --verbose

# tests-windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run tests for Windows
# working-directory: ./canyon_sql
# run: cargo test --verbose

# tests-macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v3
# - name: Run tests for macOS
# working-directory: ./canyon_sql
# run: cargo test --verbose

gcov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use nightly toolchain
run: |
rustup toolchain install nightly
rustup override set nightly
- name: Run tests
env:
CARGO_INCREMENTAL: '0'
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'
run: |
cargo test --all-features --no-fail-fast --target=x86_64-unknown-linux-gnu
- uses: actions-rs/[email protected]
# with:
# config: .github/workflows/configs/gcov-config.yml
- name: Generate code coverage report
if: always()
env:
CARGO_INCREMENTAL: '0'
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'
run: |
grcov . -s . --binary-path ./target/debug/ -t cobertura --branch --ignore-not-existing -o ./target/debug/coverage
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: "./target/debug/coverage"
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results
path: |
./target/debug/coverage/*.xml
- name: Show me directories
if: always()
run: |
ls -la ./target/debug
ls -la ./target/debug/coverage

event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Event File
path: ${{ github.event_path }}
- uses: actions/checkout@v3

- name: Use nightly toolchain
run: |
rustup toolchain install nightly
rustup override set nightly

- name: Install grcov
run: cargo install grcov

- name: Run tests
env:
CARGO_INCREMENTAL: '0'
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'
run: |
cargo test --all-features --no-fail-fast --target=x86_64-unknown-linux-gnu

- name: Generate code coverage report
if: always()
env:
CARGO_INCREMENTAL: '0'
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'
run: |
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage
grcov . -s . --binary-path ./target/debug/ -t cobertura --branch --ignore-not-existing -o ./target/debug/coverage/code_cov.xml

- name: Publish Test Results from XML
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
junit_files: "./target/debug/coverage/code_cov.xml"

- name: Show me directories
if: always()
run: |
ls -la ./target/debug
ls -la ./target/debug/coverage
ls -la ./target/debug/coverage/badges

- name: Upload
uses: actions/upload-artifact@v3
with:
name: Event File
path: ${{ github.event_path }}
- name: Publish Test Results
uses: actions/upload-artifact@v3
with:
name: Unit Test Results
path: |
./target/debug/coverage/code_cov.xml
./target/debug/coverage/index.html

- name: Publish coverage report to GitHub Pages
if: ${{ github.ref == 'refs/heads/main' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./target/debug/coverage
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# This is the root Cargo.toml file that serves as manager for the workspace of the project

[profile.dev]
panic = "abort"

[workspace]

members = [
Expand Down