From 1e2fac054cfc5920258eea15ff5eab5f60a4f9a9 Mon Sep 17 00:00:00 2001 From: Aditya Manthramurthy Date: Fri, 19 Nov 2021 16:18:23 -0800 Subject: [PATCH] Add caching to CI jobs (#13712) - Seems to be improving times for shorter jobs at least. - Remove Go 1.16.x tests for IAM and replication --- .github/workflows/go-cross.yml | 3 --- .github/workflows/go-lint.yml | 18 ++++++++++++++++++ .github/workflows/go.yml | 8 ++++++++ .github/workflows/iam-integrations.yaml | 12 ++++++++++-- .github/workflows/replication.yaml | 10 +++++++++- 5 files changed, 45 insertions(+), 6 deletions(-) diff --git a/.github/workflows/go-cross.yml b/.github/workflows/go-cross.yml index bda361d75..0d14f27a3 100644 --- a/.github/workflows/go-cross.yml +++ b/.github/workflows/go-cross.yml @@ -21,9 +21,6 @@ jobs: os: [ubuntu-latest] steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: '12' - uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index dcffbe900..5d29f653d 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -24,6 +24,24 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} + - uses: actions/cache@v2 + if: matrix.os == 'ubuntu-latest' + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.go-version }}-go- + - uses: actions/cache@v2 + if: matrix.os == 'windows-latest' + with: + path: | + %LocalAppData%\go-build + ~/go/pkg/mod + key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.go-version }}-go- - name: Build on ${{ matrix.os }} if: matrix.os == 'windows-latest' env: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 519f64772..dcaeadd69 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -24,6 +24,14 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.go-version }}-go- - name: Build on ${{ matrix.os }} if: matrix.os == 'ubuntu-latest' env: diff --git a/.github/workflows/iam-integrations.yaml b/.github/workflows/iam-integrations.yaml index 846a2b8f7..1c1f7b74d 100644 --- a/.github/workflows/iam-integrations.yaml +++ b/.github/workflows/iam-integrations.yaml @@ -50,7 +50,7 @@ jobs: # are turned off - i.e. if ldap="", then ldap server is not enabled for # the tests. matrix: - go-version: [1.16.x, 1.17.x] + go-version: [1.17.x] ldap: ["", "localhost:389"] etcd: ["", "http://localhost:2379"] openid: ["", "http://127.0.0.1:5556/dex"] @@ -68,7 +68,15 @@ jobs: - uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} - - name: Test LDAP/OpenID with Etcd combo + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.go-version }}-go- + - name: Test LDAP/OpenID/Etcd combo env: LDAP_TEST_SERVER: ${{ matrix.ldap }} ETCD_SERVER: ${{ matrix.etcd }} diff --git a/.github/workflows/replication.yaml b/.github/workflows/replication.yaml index 4bd5d525b..808773325 100644 --- a/.github/workflows/replication.yaml +++ b/.github/workflows/replication.yaml @@ -18,13 +18,21 @@ jobs: strategy: matrix: - go-version: [1.16.x, 1.17.x] + go-version: [1.17.x] steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} + - uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.go-version }}-go- - name: Test Replication run: | sudo sysctl net.ipv6.conf.all.disable_ipv6=0