From 953e1cc48547942481ff71f58fff7bb9cb76e5d2 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 7 Apr 2023 15:45:06 -0700 Subject: [PATCH] ci/gha: switch to or add ubuntu 22.04 For test jobs, add ubuntu 22.04 into the matrix, so we can test of both cgroup v1 and v2. For validate jobs, just switch to ubuntu 22.04 Signed-off-by: Kir Kolyshkin --- .github/workflows/test.yml | 25 +++++++++++++++---------- .github/workflows/validate.yml | 20 ++++++++++---------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 76687f8a026..4bdf9526b08 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,20 +19,22 @@ env: jobs: test: - runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: + os: [ubuntu-20.04, ubuntu-22.04] go-version: [1.19.x, 1.20.x] rootless: ["rootless", ""] race: ["-race", ""] - criu: [""] - include: - # Also test against latest criu-dev - - go-version: 1.19.x - rootless: "" - race: "" - criu: "criu-dev" + criu: ["", "criu-dev"] + exclude: + - criu: criu-dev + rootless: rootless + - criu: criu-dev + go-version: 1.19.x + - criu: criu-dev + race: -race + runs-on: ${{ matrix.os }} steps: @@ -42,9 +44,10 @@ jobs: - name: install deps if: matrix.criu == '' env: - REPO: https://download.opensuse.org/repositories/devel:/tools:/criu/xUbuntu_20.04 + PREFIX: https://download.opensuse.org/repositories/devel:/tools:/criu/xUbuntu run: | # criu repo + REPO=${PREFIX}_$(echo ${{ matrix.os }} | sed 's/.*-//') curl -fSsl $REPO/Release.key | sudo apt-key add - echo "deb $REPO/ /" | sudo tee /etc/apt/sources.list.d/criu.list sudo apt update @@ -64,6 +67,7 @@ jobs: - name: install go ${{ matrix.go-version }} uses: actions/setup-go@v4 with: + cache: false # https://github.com/actions/setup-go/issues/368 go-version: ${{ matrix.go-version }} - name: build @@ -88,6 +92,7 @@ jobs: sudo cp $HOME/rootless.key /home/rootless/.ssh/id_ecdsa sudo cp $HOME/rootless.key.pub /home/rootless/.ssh/authorized_keys sudo chown -R rootless.rootless /home/rootless + sudo chmod a+X $HOME # for Ubuntu 22.04 - name: integration test (fs driver) run: sudo -E PATH="$PATH" script -e -c 'make local${{ matrix.rootless }}integration' @@ -101,7 +106,7 @@ jobs: # However, we do not have 32-bit ARM CI, so we use i386 for testing 32bit stuff. # We are not interested in providing official support for i386. cross-i386: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c6ba662b220..da4ce1ff965 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -18,7 +18,7 @@ jobs: permissions: contents: read pull-requests: read - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: @@ -40,7 +40,7 @@ jobs: golangci-lint run --config .golangci-extra.yml --new-from-rev=HEAD~1 --out-format=github-actions compile-buildtags: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 env: # Don't ignore C warnings. Note that the output of "go env CGO_CFLAGS" by default is "-g -O2", so we keep them. CGO_CFLAGS: -g -O2 -Werror @@ -54,7 +54,7 @@ jobs: run: make BUILDTAGS="" codespell: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: install deps @@ -64,14 +64,14 @@ jobs: run: codespell shfmt: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: shfmt run: make shfmt shellcheck: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: install shellcheck @@ -95,7 +95,7 @@ jobs: run : ./script/check-config.sh deps: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: install go @@ -118,7 +118,7 @@ jobs: permissions: contents: read pull-requests: read - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 # Only check commits on pull requests. if: github.event_name == 'pull_request' steps: @@ -136,7 +136,7 @@ jobs: error: 'Subject too long (max 72)' cfmt: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: checkout uses: actions/checkout@v3 @@ -153,7 +153,7 @@ jobs: release: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: checkout uses: actions/checkout@v3 @@ -184,7 +184,7 @@ jobs: get-images: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 with: