-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Windows test, FFI test, and commit msg CI (#106)
* feat: Windows test, FFI test, and commit msg CI This commit improves the CI configuration by: - Adding testing for Windows - Adding testing for CCI code on Ubuntu and Windows - Adding checking for conventional commit format in commit messages - Upgrading from checkout v2 to v4 across the board. Signed-off-by: Andrew Lilley Brinker <[email protected]> * fix: resolved transient cbindgen issue This commit fixes a transient issue where cbindgen would sometimes pick up and try to build gitoid:0.3.0 instead of the current version gitoid:0.4.0. This was happening because the omnibor crate imported gitoid:0.3.0, and the two names would both appear in the output of `cargo metadata`. cbindgen would use the first one that appeared, which was sometimes gitoid:0.4.0 and sometimes gitoid:0.3.0. If it was the older version, then everything would break. This isn't really a long term fix, so there's a need to do more in the future to stop this from happening again. For now this is enough. Signed-off-by: Andrew Lilley Brinker <[email protected]> * fix: Update CI jobs from make to shell script. Haha forgot to do this when I made the replacement. We weren't really using the features of Make so I thought it would be better to just use a shell script. This commit updates CI to use that script. Signed-off-by: Andrew Lilley Brinker <[email protected]> --------- Signed-off-by: Andrew Lilley Brinker <[email protected]>
- Loading branch information
1 parent
1e21f10
commit 45fee33
Showing
10 changed files
with
105 additions
and
98 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
RUSTFLAGS: -Dwarnings | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test-linux: | ||
name: Test (Ubuntu) | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: Building | ||
run: cargo build --verbose | ||
- name: Testing (Rust) | ||
run: cargo test --verbose | ||
- name: Linting | ||
run: cargo clippy --verbose | ||
|
||
ffi-test-linux: | ||
name: FFI Test (Ubuntu) | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- name: FFI Test | ||
run: cd gitoid && ./ctest.sh | ||
|
||
ffi-test-windows: | ||
name: FFI Test (Windows) | ||
runs-on: windows-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@nightly | ||
- name: FFI Test | ||
run: cd gitoid && ./ctest.sh | ||
|
||
conventional-commits: | ||
name: Conventional Commits | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: webiny/[email protected] | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Variables for cbindgen. | ||
CBINDGEN_CONFIG="./cbindgen.toml" | ||
|
||
# Variables for the header file. | ||
INCLUDE_DIR="./include" | ||
HEADER_NAME="gitoid.h" | ||
|
||
# Variables for the DLL/archive file. | ||
LIB_DIR="../target/release" | ||
LIB_NAME="gitoid" | ||
|
||
# Variables for the test files. | ||
TEST_SRC_FILE="./test/c/test.c" | ||
TEST_EXE_FILE="./test/c_test" | ||
|
||
echo "--------------------------------------------------" | ||
echo "BUILDING LIBRARY" | ||
cargo build -p "gitoid:0.4.0" --release --verbose | ||
|
||
echo "--------------------------------------------------" | ||
echo "GENERATING C HEADER FILE" | ||
mkdir -p "${INCLUDE_DIR}" | ||
cbindgen -v --clean -c "${CBINDGEN_CONFIG}" -o "${INCLUDE_DIR}/${HEADER_NAME}" --crate "gitoid" | ||
|
||
echo "--------------------------------------------------" | ||
echo "BUILDING C TEST FILE" | ||
gcc --std=c99 -I"${INCLUDE_DIR}" -L"${LIB_DIR}" -o"${TEST_EXE_FILE}" "${TEST_SRC_FILE}" -l"${LIB_NAME}" | ||
|
||
echo "--------------------------------------------------" | ||
echo "RUNNING C TEST FILE" | ||
PATH="${LIB_DIR}:${PATH}" LD_LIBRARY_PATH="${LIB_DIR}" "${TEST_EXE_FILE}" | ||
|
||
echo "--------------------------------------------------" | ||
echo "DELETING C TEST FILE" | ||
rm "${TEST_EXE_FILE}" | ||
|
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
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
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
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
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