Consolidate windows and linux CIs
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
parent
84cc3d9f7b
commit
08c563b51a
|
|
@ -14,7 +14,7 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
@ -41,19 +41,24 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: ./scripts/install-protobuf.sh
|
- run: ./scripts/install-protobuf.sh
|
||||||
- env:
|
- run: |
|
||||||
# runc::tests::test_exec needs $XDG_RUNTIME_DIR to be set
|
|
||||||
XDG_RUNTIME_DIR: /tmp/dummy-xdr
|
|
||||||
run: |
|
|
||||||
# runc-shim::cgroup::test_add_cgroup needs root permission to set cgroup
|
# runc-shim::cgroup::test_add_cgroup needs root permission to set cgroup
|
||||||
mkdir -p /tmp/dummy-xdr
|
mkdir -p /tmp/dummy-xdr
|
||||||
sudo -E $(command -v cargo) test
|
sudo -E $(command -v cargo) test
|
||||||
sudo -E $(command -v cargo) test --all-features
|
sudo -E $(command -v cargo) test --all-features
|
||||||
|
if: ${{ !contains(matrix.os, 'windows') }}
|
||||||
|
env:
|
||||||
|
# runc::tests::test_exec needs $XDG_RUNTIME_DIR to be set
|
||||||
|
XDG_RUNTIME_DIR: /tmp/dummy-xdr
|
||||||
|
- run: |
|
||||||
|
cargo test
|
||||||
|
cargo test --all-features
|
||||||
|
if: ${{ contains(matrix.os, 'windows') }}
|
||||||
|
|
||||||
# Collect build timings
|
# Collect build timings
|
||||||
# See https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html#cargo---timings
|
# See https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html#cargo---timings
|
||||||
|
|
@ -81,8 +86,8 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: EmbarkStudios/cargo-deny-action@v1
|
- uses: EmbarkStudios/cargo-deny-action@v1
|
||||||
|
|
||||||
integration:
|
linux-integration:
|
||||||
name: Integration
|
name: Linux Integration
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
timeout-minutes: 40
|
timeout-minutes: 40
|
||||||
|
|
||||||
|
|
@ -140,6 +145,58 @@ jobs:
|
||||||
sudo -E PATH=$PATH make integration
|
sudo -E PATH=$PATH make integration
|
||||||
working-directory: src/github.com/containerd/containerd
|
working-directory: src/github.com/containerd/containerd
|
||||||
|
|
||||||
|
windows-integration:
|
||||||
|
name: Windows Integration
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 40
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [windows-latest]
|
||||||
|
containerd: [1.7.0]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout extensions
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install containerd
|
||||||
|
run: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
# Install containerd https://github.com/containerd/containerd/blob/v1.7.0/docs/getting-started.md#installing-containerd-on-windows
|
||||||
|
# Download and extract desired containerd Windows binaries
|
||||||
|
curl.exe -L https://github.com/containerd/containerd/releases/download/v${{ matrix.containerd }}/containerd-${{ matrix.containerd }}-windows-amd64.tar.gz -o containerd-windows-amd64.tar.gz
|
||||||
|
tar.exe xvf .\containerd-windows-amd64.tar.gz
|
||||||
|
|
||||||
|
# Copy and configure
|
||||||
|
mkdir "$Env:ProgramFiles\containerd"
|
||||||
|
Copy-Item -Path ".\bin\*" -Destination "$Env:ProgramFiles\containerd" -Recurse -Force
|
||||||
|
cd $Env:ProgramFiles\containerd\
|
||||||
|
.\containerd.exe config default | Out-File config.toml -Encoding ascii
|
||||||
|
|
||||||
|
# Review the configuration. Depending on setup you may want to adjust:
|
||||||
|
# - the sandbox_image (Kubernetes pause image)
|
||||||
|
# - cni bin_dir and conf_dir locations
|
||||||
|
Get-Content config.toml
|
||||||
|
|
||||||
|
# Register and start service
|
||||||
|
.\containerd.exe --register-service
|
||||||
|
Start-Service containerd
|
||||||
|
working-directory: ${{ runner.temp }}
|
||||||
|
- name: Run integration test
|
||||||
|
run: |
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
get-service containerd
|
||||||
|
$env:TTRPC_ADDRESS="\\.\pipe\containerd-containerd.ttrpc"
|
||||||
|
|
||||||
|
# run the example
|
||||||
|
cargo run -p containerd-shim --example skeleton -- -namespace default -id 1234 -address "\\.\pipe\containerd-containerd" -publish-binary ./bin/containerd start
|
||||||
|
ps skeleton
|
||||||
|
cargo run -p containerd-shim-protos --example shim-proto-connect \\.\pipe\containerd-shim-17630016127144989388-pipe
|
||||||
|
$skeleton = get-process skeleton -ErrorAction SilentlyContinue
|
||||||
|
if ($skeleton) { exit 1 }
|
||||||
|
|
||||||
# Currently Github actions UI supports no masks to mark matrix jobs as required to pass status checks.
|
# Currently Github actions UI supports no masks to mark matrix jobs as required to pass status checks.
|
||||||
# This means that every time version of Go, containerd, or OS is changed, a corresponding job should
|
# This means that every time version of Go, containerd, or OS is changed, a corresponding job should
|
||||||
# be added to the list of required checks. Which is not very convenient.
|
# be added to the list of required checks. Which is not very convenient.
|
||||||
|
|
@ -151,7 +208,7 @@ jobs:
|
||||||
name: Report required job statuses
|
name: Report required job statuses
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# List job dependencies which are required to pass status checks in order to be merged via merge queue.
|
# List job dependencies which are required to pass status checks in order to be merged via merge queue.
|
||||||
needs: [checks, tests, deny, integration]
|
needs: [checks, tests, deny, linux-integration, windows-integration]
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
steps:
|
steps:
|
||||||
- run: exit 1
|
- run: exit 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue