Skip to content

Commit

Permalink
fix: unit tests for aarch64 architetures (#54)
Browse files Browse the repository at this point in the history
tome unit tests we're not working for aarch64, which seem to due to Python's availability on each platform.

Expanding the workflow file with help from @zph to expand testing surface.
  • Loading branch information
toumorokoshi authored Apr 1, 2024
1 parent f8233b8 commit 944b3e2
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 91 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/linux-build.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Release
on:
# # Indicates I want to run this workflow on all branches, PR, and tags
push:
branches: ["*"]
tags: ["*"]
pull_request:
branches: ["master"]

env:
BIN_NAME: "tome"
CRATE_NAME: tome

jobs:
build:
name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os_name: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
bin: tome
name: tome-linux-x86_64
- os_name: Linux-aarch64
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
bin: tome
name: tome-linux-aarch64
- os_name: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
bin: tome
name: tome-darwin-x86_64
- os_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
bin: tome
name: tome-darwin-aarch64
# The action does not support running tests on aarch64-apple-darwin.
# https://github.com/houseabsolute/actions-rust-cross?tab=readme-ov-file#input-parameters
skip_tests: true
toolchain:
- stable
- beta
steps:
- uses: actions/checkout@v3
- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
if: contains(matrix.platform.name, 'musl')
- name: Build binary
uses: houseabsolute/[email protected]
with:
command: "build"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--locked --release"
strip: true
- name: Run tests
uses: houseabsolute/actions-rust-cross@v0
with:
command: "test"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--locked --release"
if: ${{ !matrix.platform.skip_tests }}
38 changes: 0 additions & 38 deletions .github/workflows/osx-build.yml

This file was deleted.

18 changes: 12 additions & 6 deletions example/file_example
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#!/usr/bin/env python
#!/usr/bin/env bash
# SUMMARY: hey'
# COMPLETE
# START HELP
# this is an example of a simple script written in python.
# END HELP
import sys
#import sys

# when attempting to complete a variable,
# --complete will be passed, with the full argument set.
# for example,
# $ cb file_example foo a --complete
# will pass all arguments (the "a" should be autocompleted.)
if len(sys.argv) > 1 and sys.argv[1] == "--complete":
sys.stdout.write("file autocomplete example")
else:
print("hello")
if [ "${1}" == "--complete" ]; then
echo -n "file autocomplete example"
else
echo "hello"
fi

#if len(sys.argv) > 1 and sys.argv[1] == "--complete":
# sys.stdout.write("file autocomplete example")
#else:
# print("hello")
2 changes: 1 addition & 1 deletion example/test_files/file_example_no_completion
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# SUMMARY: hey'
# START HELP
# this is an example of a simple script written in python.
Expand Down
2 changes: 1 addition & 1 deletion src/lib_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn test_simple_script_completion() {
}

/// Unless the file has the completion annotation
/// do not invoked completion on it and return nothing
/// do not invoke completion on it and return nothing
/// instead.
#[test]
fn test_simple_script_no_completion() {
Expand Down

0 comments on commit 944b3e2

Please sign in to comment.