Skip to content
Open
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
48 changes: 46 additions & 2 deletions .github/workflows/unitctl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,50 @@ permissions:
contents: write

jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: tools/unitctl
env:
MAKE: make
CARGO: cargo
VERSION:
SHORT_VERSION:
strategy:
fail-fast: false
matrix:
include:
- build: linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- build: macos-x86_64
os: macos-latest
target: x86_64-apple-darwin
steps:
- uses: actions/checkout@v4

- run: rustup update stable
- run: rustup target add ${{ matrix.target }}

- name: Install macOS depedencies
if: startsWith(matrix.os, 'macos')
run: |
brew install make gnu-sed grep gawk
echo "MAKE=gmake" >> $GITHUB_ENV

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21

- run: ${{ env.MAKE }} list-targets

- name: Generate openapi
run: ${{ env.MAKE }} openapi-generate
- name: Test ${{ matrix.os }}
run: ${{ env.MAKE }} test

build:
runs-on: ${{ matrix.os }}
defaults:
Expand Down Expand Up @@ -60,7 +104,7 @@ jobs:
workspaces: ./tools/unitctl -> target
save-if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}

- name: Configure linux arm depedencies
- name: Configure linux arm dependencies
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
cat <<EOF > Cross.toml
Expand All @@ -74,7 +118,7 @@ jobs:
cat Cross.toml
echo "CARGO=cross" >> $GITHUB_ENV

- name: Install macOS depedencies
- name: Install macOS dependencies
if: startsWith(matrix.os, 'macos')
run: |
brew install make gnu-sed grep gawk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ mod tests {
}

#[test]
#[ignore]
fn can_run_unitd() {
let specific_path = std::env::var(UNITD_PATH_ENV_KEY).map_err(|error| Box::new(error) as Box<dyn stdError>);
let unitd_path = unitd_instance::find_executable_path(specific_path);
Expand Down
1 change: 1 addition & 0 deletions tools/unitctl/unitctl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# meaningless change
[package]
name = "unitctl"
description = "CLI interface to the NGINX UNIT Control API"
Expand Down