From 536ee0975faf05d665a6692209650b7119d74f3a Mon Sep 17 00:00:00 2001 From: Zac Berkowitz Date: Mon, 19 Jul 2021 16:31:52 -0400 Subject: [PATCH] add virtual serial port names to environment variables. --- .github/workflows/github-ci.yml | 93 +++++++++++++++++++++++++++------ 1 file changed, 77 insertions(+), 16 deletions(-) diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml index 6b2d837..a910734 100644 --- a/.github/workflows/github-ci.yml +++ b/.github/workflows/github-ci.yml @@ -4,18 +4,17 @@ on: schedule: - cron: '0 8 15 * *' jobs: - ci: - runs-on: ${{ matrix.os }} + ci-linux: + runs-on: ubuntu-latest strategy: matrix: rust: - stable # - beta # - nightly - os: - # - macos-latest - # - ubuntu-latest - - windows-latest + env: + TEST_PORT_A: /tmp/ttyS10 + TEST_PORT_B: /tmp/ttyS11 steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -26,36 +25,98 @@ jobs: components: rustfmt, clippy - uses: Swatinem/rust-cache@v1 - name: install socat - if: ${{ runner.os == 'Linux' }} run: | sudo apt-get update sudo apt-get install socat -y socat -V + - name: cargo test + run: cargo test -j1 -- --test-threads=1 + env: + TEST_PORT_NAMES: ${{ env.TEST_PORT_A }};${{ env.TEST_PORT_B }} + - name: cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + - name: check format + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check + ci-macOS: + runs-on: macos-latest + strategy: + matrix: + rust: + - stable + # - beta + # - nightly + env: + TEST_PORT_A: /tmp/ttyS10 + TEST_PORT_B: /tmp/ttyS11 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v1 - name: install socat - if: ${{ runner.os == 'macOS' }} run: | brew install socat socat -V env: HOMEBREW_NO_AUTO_UPDATE: 1 + - name: cargo test + run: cargo test -j1 -- --test-threads=1 + env: + TEST_PORT_NAMES: ${{ env.TEST_PORT_A }};${{ env.TEST_PORT_B }} + - name: cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + - name: check format + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check + ci-windows: + runs-on: windows-latest + strategy: + matrix: + rust: + - stable + # - beta + # - nightly + env: + TEST_PORT_A: COM10 + TEST_PORT_B: COM11 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v1 - uses: ilammy/msvc-dev-cmd@v1 - if: ${{ runner.os == 'Windows' }} - name: install com0com - if: ${{ runner.os == 'Windows' }} run: | CertMgr.exe /add com0com.cer /s /r localMachine root CertMgr.exe /add com0com.cer /s /r localMachine trustedpublisher .\setup_com0com_W7_x64_signed.exe /S working-directory: .github - name: setup com0com - if: ${{ runner.os == 'Windows' }} - run: .\setupc.exe install PortName=COM10,EmuBR=yes PortName=COM11,EmuBR=yes + run: .\setupc.exe install PortName=${{ env.TEST_PORT_A }},EmuBR=yes PortName=${{ env.TEST_PORT_B }},EmuBR=yes working-directory: C:\Program Files (x86)\com0com - name: cargo test - uses: actions-rs/cargo@v1 - with: - command: test - args: -j1 -- --test-threads=1 + run: cargo test -j1 -- --test-threads=1 + env: + TEST_PORT_NAMES: ${{ env.TEST_PORT_A }};${{ env.TEST_PORT_B }} - name: cargo clippy uses: actions-rs/cargo@v1 with: