better instrumentation/structured args section
#24
This file contains hidden or 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
| name: Test Validate | |
| on: | |
| push: | |
| pull_request: | |
| branches: | |
| - master | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| check: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| name: Check on ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Run tests | |
| run: cargo test --all | |
| - name: Run clippy | |
| run: cargo clippy --all -- -D warnings | |
| validate: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| plugin: [clack-synth] | |
| include: | |
| - os: ubuntu-latest | |
| plugin: clack-synth | |
| plugin_lib: libclack_synth.so | |
| - os: windows-latest | |
| plugin: clack-synth | |
| plugin_lib: clack_synth.dll | |
| - os: macos-latest | |
| plugin: clack-synth | |
| plugin_lib: libclack_synth.dylib | |
| runs-on: ${{ matrix.os }} | |
| name: Validate ${{ matrix.plugin }} on ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Build validator | |
| run: cargo build -p clap-validator | |
| - name: Build plugin | |
| run: | | |
| cargo build -p ${{ matrix.plugin }} | |
| - name: Bundle plugin | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| mkdir -p "./target/debug/${{ matrix.plugin }}.clap/Contents/MacOS" | |
| cp "./target/debug/${{ matrix.plugin_lib }}" "./target/debug/${{ matrix.plugin }}.clap/Contents/MacOS/${{ matrix.plugin_lib }}" | |
| # Create PkgInfo | |
| echo "BNDL????" > "./target/debug/${{ matrix.plugin }}.clap/Contents/PkgInfo" | |
| # Create minimal Info.plist | |
| cat <<EOF > "./target/debug/${{ matrix.plugin }}.clap/Contents/Info.plist" | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>CFBundleExecutable</key> | |
| <string>${{ matrix.plugin_lib }}</string> | |
| <key>CFBundleIdentifier</key> | |
| <string>com.example.${{ matrix.plugin }}</string> | |
| <key>CFBundleName</key> | |
| <string>${{ matrix.plugin }}</string> | |
| <key>CFBundleVersion</key> | |
| <string>1.0</string> | |
| </dict> | |
| </plist> | |
| EOF | |
| echo "PLUGIN_PATH=./target/debug/${{ matrix.plugin }}.clap" >> $GITHUB_ENV | |
| - name: Bundle plugin | |
| if: matrix.os != 'macos-latest' | |
| run: | | |
| echo "PLUGIN_PATH=./target/debug/${{ matrix.plugin_lib }}" >> $GITHUB_ENV | |
| - name: Run validator | |
| run: | | |
| "target/debug/clap-validator" validate "$PLUGIN_PATH" |