ci #312
This file contains 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: ci | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
schedule: | |
# Run every day at 6:00 UTC | |
- cron: '00 6 * * *' | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: 📦 NuGet Cache | |
uses: actions/cache@v3 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: 📦 Cargo Cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
tools/slicec-cs/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo- | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
8.0.x | |
9.0.x | |
- name: Setup Ice 3.7 | |
run: | | |
sudo mkdir -p /etc/apt/keyrings | |
sudo curl -fsSL https://download.zeroc.com/GPG-KEY-zeroc-release-B6391CB2CFBA643D | sudo gpg --dearmor -o /etc/apt/keyrings/zeroc.gpg | |
echo \ | |
"deb [signed-by=/etc/apt/keyrings/zeroc.gpg] https://download.zeroc.com/ice/3.7/ubuntu22.04 stable main" \ | |
| sudo tee /etc/apt/sources.list.d/zeroc-ice-3.7.list | |
sudo apt-get update | |
sudo apt-get install zeroc-ice-slice zeroc-ice-compilers | |
- name: Check out IceRPC for C# repository | |
uses: actions/checkout@master | |
with: | |
repository: icerpc/icerpc-csharp | |
path: 'icerpc-csharp' | |
- name: 🔨 Build and Publish IceRPC NuGet packages | |
working-directory: icerpc-csharp | |
run: ./build.sh --publish | |
- name: 🔨 Build Tests | |
run: dotnet build | |
- name: 🧪 Run Tests | |
run: dotnet test --no-build --verbosity normal |