Merge pull request #33 from nsg-ethz/dependabot/cargo/socket2-0.6.2 #151
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 | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| - "!dependabot/**" | |
| pull_request: | |
| branches: [main] | |
| workflow_call: | |
| jobs: | |
| test: | |
| name: Test [${{ matrix.rust }}, ${{ matrix.profile }}] | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rust: [stable, nightly] | |
| profile: [dev] | |
| include: | |
| - rust: stable | |
| profile: release | |
| # Anything nightly is treated as informational-only. | |
| continue-on-error: ${{ matrix.rust == 'nightly' }} | |
| steps: | |
| - name: "Set environmental variables" | |
| shell: bash | |
| run: | | |
| #RUST_BACKTRACE_nightly='1' | |
| #CFLAGS_nightly='-fsanitize=leak' | |
| #CXXFLAGS_nightly='-fsanitize=leak' | |
| #RUSTFLAGS_nightly='-Zsanitizer=leak' | |
| # A function for defining a variable conditional on the toolchain in | |
| # use. | |
| tc_var() { | |
| # Replace any dots in the toolchain name with underscores. Necessary | |
| # due to shell imposed variable naming restrictions. | |
| var="${1}_$(echo ${{ matrix.rust }} | tr . _)" | |
| echo "${1}=${!var}" >> ${GITHUB_ENV} | |
| } | |
| tc_var RUST_BACKTRACE | |
| tc_var RUSTFLAGS | |
| tc_var CFLAGS | |
| tc_var CXXFLAGS | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| components: rustfmt | |
| - name: Install deps | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install --yes --no-install-recommends clang-18 libelf-dev zlib1g-dev linux-headers-$(uname -r) libmsquic | |
| sudo ln -s /usr/include/asm-generic /usr/include/asm | |
| sudo rm -f /bin/clang && sudo ln -s /usr/bin/clang-18 /bin/clang | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --profile=${{ matrix.profile }} --locked --verbose --workspace | |
| - name: Generate certificate | |
| run: cargo rcgen | |
| - name: Run tests | |
| run: cargo test --profile=${{ matrix.profile }} --locked --verbose --workspace |