Skip to content

dep: Update mstest monorepo to 3.6.4 #472

dep: Update mstest monorepo to 3.6.4

dep: Update mstest monorepo to 3.6.4 #472

Workflow file for this run

name: CI
on: [push, pull_request, workflow_dispatch]
env:
ProjectName: ${{ github.event.repository.name }}
RustProjectName: cryptobase
jobs:
check_format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Check .NET format
working-directory: src
run: dotnet format -v diag --verify-no-changes
- uses: Swatinem/rust-cache@v2
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install stable --component clippy
rustup default stable
rustup override set stable
- name: Check Rust format
working-directory: native/${{ env.RustProjectName }}
run: cargo clippy --release --all-targets --all-features
build-native:
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: i686-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: full
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install stable
rustup default stable
rustup override set stable
rustup target add --toolchain stable ${{ matrix.target }}
- name: Install cross
if: matrix.os == 'ubuntu-latest'
run: cargo install cross
- name: Build ${{ matrix.target }}
shell: pwsh
run: .\build\build-native.ps1 ${{ matrix.target }}
- name: Upload ${{ matrix.target }}
uses: actions/upload-artifact@v3
with:
name: runtimes
path: src/${{ env.ProjectName }}/runtimes/
test:
needs: [build-native]
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: full
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: runtimes
path: src/${{ env.ProjectName }}/runtimes/
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Run tests
working-directory: src/${{ env.ProjectName }}.Tests
run: dotnet test -c Release
build:
needs: [check_format, test]
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
strategy:
matrix:
NugetProjectName:
- CryptoBase
- CryptoBase.Abstractions
- CryptoBase.BouncyCastle
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
working-directory: src/${{ matrix.NugetProjectName }}
run: dotnet build -c Release
- name: Push nuget packages
working-directory: src/${{ matrix.NugetProjectName }}/bin/Release
run: |
dotnet nuget push *.nupkg -s https://nuget.pkg.github.com/HMBSbige -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NuGetAPIKey }} --skip-duplicate
dotnet nuget push *.snupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NuGetAPIKey }} --skip-duplicate
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false