Add command line arguments + config parsing #460
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: Continuous integration | |
| on: [push, pull_request] | |
| jobs: | |
| Test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust: | |
| - 1.85.0 # MSRV | |
| - stable | |
| - nightly | |
| env: | |
| # Override the value from the rust-toolchain file | |
| # This is necessary because even though the correct toolchain | |
| # is explicitly specified for the rust-toolchain action, | |
| # rustup honors the rust-toolchain file over the default | |
| RUSTUP_TOOLCHAIN: ${{ matrix.rust }} | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - name: "Install ${{ matrix.rust }} toolchain" | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| # The toolchain must be specified manually, as this action ignores the rust-toolchain override | |
| # https://github.com/dtolnay/rust-toolchain?tab=readme-ov-file#inputs | |
| toolchain: ${{ matrix.rust }} | |
| - name: "Install nix" | |
| uses: DeterminateSystems/determinate-nix-action@main | |
| - name: "Use nix cache" | |
| uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: "Add nginxWithStream to PATH" | |
| run: | | |
| # This is necessary for ohttp-relay integration tests | |
| echo "$(nix build .#nginx-with-stream --print-out-paths --no-link)/bin" >> $GITHUB_PATH | |
| - name: "Use cache" | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: RUST_LOG=debug bash contrib/test.sh | |
| Lint-FFI: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - name: "Install nightly toolchain" | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy | |
| - name: "Use cache" | |
| uses: Swatinem/rust-cache@v2 | |
| - name: "Run linting check" | |
| run: cd payjoin-ffi && bash contrib/lint.sh | |
| Lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - name: "Install nightly toolchain" | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: clippy | |
| - name: "Use cache" | |
| uses: Swatinem/rust-cache@v2 | |
| - name: "Run code linting" | |
| run: bash contrib/lint.sh | |
| - name: "Run documentation linting" | |
| run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --document-private-items | |
| Coverage: | |
| name: Code coverage | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| env: | |
| # Override the value from the rust-toolchain file | |
| # This is necessary because even though the correct toolchain | |
| # is explicitly specified for the rust-toolchain action, | |
| # rustup honors the rust-toolchain file over the default | |
| RUSTUP_TOOLCHAIN: stable | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| - name: "Install toolchain" | |
| # rust-cache usage with stable Rust is most effective, as a cache is tied to the Rust version | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: "Install nix" | |
| uses: DeterminateSystems/determinate-nix-action@main | |
| - name: "Use nix cache" | |
| uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: "Add nginxWithStream to PATH" | |
| run: | | |
| # This is necessary for ohttp-relay integration tests | |
| echo "$(nix build .#nginx-with-stream --print-out-paths --no-link)/bin" >> $GITHUB_PATH | |
| - name: "Use cache" | |
| uses: Swatinem/rust-cache@v2 | |
| - name: "Install cargo-llvm-cov" | |
| uses: taiki-e/install-action@cargo-llvm-cov | |
| - name: "Generate code coverage for tests" | |
| run: bash contrib/coverage.sh | |
| - name: "Upload report to coveralls" | |
| uses: coverallsapp/github-action@v2 | |
| CodeSpell: | |
| name: Code spell check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: codespell-project/actions-codespell@v2 | |
| DiffMutants: | |
| name: Diff cargo-mutants | |
| runs-on: ubuntu-latest | |
| env: | |
| RUSTUP_TOOLCHAIN: stable | |
| steps: | |
| - name: "Checkout repo" | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # required for full diff context | |
| - name: Fetch base branch for diff | |
| run: git fetch origin ${{ github.base_ref }} | |
| - name: Relative diff | |
| run: | | |
| git branch -av | |
| git diff origin/${{ github.base_ref }}.. -- '*.rs' | tee git.diff | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: [email protected] | |
| - name: "Install toolchain" | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: "Use cache" | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo-mutants on diff | |
| run: > | |
| cargo mutants --no-shuffle --in-diff git.diff | |
| --test-tool=cargo --timeout=500 --build-timeout=500 | |
| - name: Upload mutants.out | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: mutants-incremental-cargo.out | |
| path: mutants.out |