diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2acbb0baa..e6ccafe05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,17 +30,17 @@ jobs: runs-on: ubuntu-20.04 steps: - - name: Set up Go ${{ matrix.go }} - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go }} - - name: Check out code into the Go module directory uses: actions/checkout@v4 with: # to add commit DCO checks later fetch-depth: 21 + - name: Set up Go ${{ matrix.go }} + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + - name: Check code uses: golangci/golangci-lint-action@v4.0.0 with: diff --git a/.github/workflows/build_setup.yml b/.github/workflows/build_setup.yml index 1601073d2..50b136b74 100644 --- a/.github/workflows/build_setup.yml +++ b/.github/workflows/build_setup.yml @@ -22,14 +22,16 @@ jobs: name: Build setup scripts runs-on: ubuntu-20.04 steps: - - name: Set up Go 1.21 - uses: actions/setup-go@v5 - with: - go-version: '1.21' - + - name: Check out the code uses: actions/checkout@v4 + - name: Set up Go version in go.mod file + uses: actions/setup-go@v5 + with: + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum + - name: Build scripts run: pushd scripts && go build -o setup_tool && popd diff --git a/.github/workflows/cri_minio_test.yml b/.github/workflows/cri_minio_test.yml index e8ab7f199..b80cfb897 100644 --- a/.github/workflows/cri_minio_test.yml +++ b/.github/workflows/cri_minio_test.yml @@ -33,14 +33,15 @@ jobs: steps: - name: Setup TMPDIR run: mkdir -p $TMPDIR + + - name: Check out code into the Go module directory + uses: actions/checkout@v4 - - name: Set up Go 1.21 + - name: Set up Go version in go.mod file uses: actions/setup-go@v5 with: - go-version: '1.21' - - - name: Check out code into the Go module directory - uses: actions/checkout@v4 + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum - name: Build run: go build diff --git a/.github/workflows/cri_stock_containerd_test.yml b/.github/workflows/cri_stock_containerd_test.yml index 2dc5c3d9c..3e93fd3e6 100644 --- a/.github/workflows/cri_stock_containerd_test.yml +++ b/.github/workflows/cri_stock_containerd_test.yml @@ -23,10 +23,12 @@ jobs: - name: Check out code into the Go module directory uses: actions/checkout@v4 - - name: Set up golang + - name: Set up Go version in go.mod file uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum + - name: Build setup scripts run: pushd scripts && go build -o setup_tool && popd diff --git a/.github/workflows/cri_tests.yml b/.github/workflows/cri_tests.yml index aadf88bd6..3fcb18df0 100644 --- a/.github/workflows/cri_tests.yml +++ b/.github/workflows/cri_tests.yml @@ -27,10 +27,12 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up golang + - name: Set up Go version in go.mod file uses: actions/setup-go@v5 with: - go-version: "1.21" + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum + - name: Add rsync run: | diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 2bfcd88e4..d5367baef 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -30,11 +30,17 @@ jobs: matrix: test-name: [test, test-man-bench] steps: + + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + with: + lfs: true - - name: Set up Go 1.21 + - name: Set up Go version in go.mod file uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum - name: Set up Python 3.x uses: actions/setup-python@v5 @@ -51,11 +57,6 @@ jobs: run: | sudo apt update sudo apt install rsync -y - - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - with: - lfs: true - name: Build setup scripts run: pushd scripts && go build -o setup_tool && popd diff --git a/.github/workflows/nightly_tests.yml b/.github/workflows/nightly_tests.yml index 7707a2b72..561e7a519 100644 --- a/.github/workflows/nightly_tests.yml +++ b/.github/workflows/nightly_tests.yml @@ -19,23 +19,24 @@ jobs: steps: - name: Setup TMPDIR run: mkdir -p $TMPDIR - - - name: Set up Go 1.21 - uses: actions/setup-go@v5 - with: - go-version: '1.21' - + - name: Upgrade git run: | sudo add-apt-repository ppa:git-core/ppa -y sudo apt update sudo apt install git -y - + - name: Check out code into the Go module directory uses: actions/checkout@v4 with: lfs: true + - name: Set up Go version in go.mod file + uses: actions/setup-go@v5 + with: + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum + - name: Build setup scripts run: pushd scripts && go build -o setup_tool && popd @@ -77,14 +78,15 @@ jobs: - name: Setup TMPDIR run: mkdir -p $TMPDIR - - name: Set up Go 1.21 - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - name: Check out code into the Go module directory uses: actions/checkout@v4 + - name: Set up Go version in go.mod file + uses: actions/setup-go@v5 + with: + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum + - name: Build setup scripts run: pushd scripts && go build -o setup_tool && popd diff --git a/.github/workflows/openyurt-unit-test.yml b/.github/workflows/openyurt-unit-test.yml index f3187e7fa..5e3818485 100644 --- a/.github/workflows/openyurt-unit-test.yml +++ b/.github/workflows/openyurt-unit-test.yml @@ -22,14 +22,15 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.21 - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - name: Check out the code uses: actions/checkout@v4 + - name: Set up Go version in go.mod file + uses: actions/setup-go@v5 + with: + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum + - name: Build scripts run: pushd scripts/openyurt-deployer && go build -o oy_deploy && popd diff --git a/.github/workflows/stargz_tests.yml b/.github/workflows/stargz_tests.yml index 2ad8519e2..0b8e93966 100644 --- a/.github/workflows/stargz_tests.yml +++ b/.github/workflows/stargz_tests.yml @@ -42,10 +42,11 @@ jobs: - name: Checkout LFS objects run: git lfs checkout - - name: Set up Go 1.21 + - name: Set up Go version in go.mod file uses: actions/setup-go@v5 with: - go-version: '1.21' + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum - name: Build setup scripts run: pushd scripts && go build -o setup_tool && popd diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 8cd9def45..493b1c7f8 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -28,20 +28,20 @@ jobs: matrix: module: [misc, networking, snapshotting] steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 - - name: Set up Go 1.21 + - name: Set up Go version in go.mod file uses: actions/setup-go@v5 with: - go-version: '1.21' - + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum + - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - - name: Build setup scripts run: pushd scripts && go build -o setup_tool && popd @@ -73,20 +73,20 @@ jobs: matrix: module: [profile] steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 - - name: Set up Go 1.21 + - name: Set up Go version in go.mod file uses: actions/setup-go@v5 with: - go-version: '1.21' - + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum + - name: Set up Python 3.x uses: actions/setup-python@v5 with: python-version: '3.x' - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - - name: Build setup scripts run: pushd scripts && go build -o setup_tool && popd @@ -121,22 +121,22 @@ jobs: matrix: module: [ ctriface, ctriface/image, devmapper ] steps: - - - name: Set up Go 1.21 - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - name: Upgrade git run: | sudo add-apt-repository ppa:git-core/ppa -y sudo apt update sudo apt install git -y - + - name: Check out code into the Go module directory uses: actions/checkout@v4 with: lfs: true + + - name: Set up Go version in go.mod file + uses: actions/setup-go@v5 + with: + go-version-file: ${{ github.workspace }}/go.mod + cache-dependency-path: ${{ github.workspace }}/go.sum - name: Add rsync run: |