Continuous Integration #166
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: Continuous Integration | |
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- | |
- name: 🔗 Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: "7.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 | |
token: ${{ secrets.ICERPC_CSHARP_READ_TOKEN }} | |
path: 'icerpc-csharp' | |
- name: 🔗 Start SSH Agent | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SLICEC_DEPLOY_KEY }} | |
- 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 |