Skip to content

Commit 01ac7fb

Browse files
committed
Move Ghac cache to another repo
1 parent 5730791 commit 01ac7fb

2 files changed

Lines changed: 58 additions & 29 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Test Service GHAC v2
19+
description: 'Test GHAC v2 service'
20+
inputs:
21+
github_token:
22+
description: 'A Github token'
23+
required: true
24+
25+
runs:
26+
using: "composite"
27+
steps:
28+
- name: Setup Rust toolchain
29+
uses: ./.github/actions/setup
30+
with:
31+
need-nextest: true
32+
33+
- name: Configure Cache Env
34+
uses: actions/github-script@v9
35+
with:
36+
script: |
37+
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
38+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
39+
core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on');
40+
41+
- name: Test
42+
shell: bash
43+
working-directory: core
44+
run: cargo test behavior --features tests,services-ghac
45+
env:
46+
OPENDAL_TEST: ghac
47+
GITHUB_TOKEN: ${{ inputs.github_token }}

.github/workflows/service_test_ghac.yml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,48 +25,30 @@ on:
2525
branches:
2626
- main
2727
paths:
28+
- ".github/workflows/service_test_ghac.yml"
29+
- ".github/actions/test_service_ghac_v2/**"
2830
- "core/Cargo.toml"
2931
- "core/Cargo.lock"
3032
- "core/core/Cargo.toml"
3133
- "core/core/src/**"
32-
- "core/layers/**"
33-
- "core/testkit/**"
34-
- "core/tests/**"
3534
- "!core/core/src/docs/**"
35+
- "core/layers/**"
3636
- "core/services/azblob/**"
3737
- "core/services/azure-common/**"
3838
- "core/services/ghac/**"
39-
- ".github/workflows/service_test_ghac.yml"
39+
- "core/testkit/**"
40+
- "core/tests/**"
4041

4142
concurrency:
4243
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
4344
cancel-in-progress: true
4445

4546
jobs:
4647
ghac_v2:
47-
runs-on: ubuntu-latest
4848
if: github.event_name == 'push' || !github.event.pull_request.head.repo.fork
49-
permissions:
50-
actions: write
51-
steps:
52-
- uses: actions/checkout@v6
53-
- name: Setup Rust toolchain
54-
uses: ./.github/actions/setup
55-
with:
56-
need-nextest: true
57-
58-
- name: Configure Cache Env
59-
uses: actions/github-script@v9
60-
with:
61-
script: |
62-
core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
63-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
64-
core.exportVariable('ACTIONS_CACHE_SERVICE_V2', 'on');
65-
66-
- name: Test
67-
shell: bash
68-
working-directory: core
69-
run: cargo test behavior --features tests,services-ghac
70-
env:
71-
OPENDAL_TEST: ghac
72-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
# `opendal-ghac-service-continuous-integration` repo contains an action wrapper that delegates
50+
# implementation on opendal repo but runs and store caches in `opendal-ghac-service-continuous-integration` repo.
51+
# We want to reduce cache load on GitHub for a single repo.
52+
uses: apache/opendal-ghac-service-continuous-integration/.github/workflows/service-ghac-v2-test.yml@main
53+
with:
54+
ref: ${{ github.sha }}

0 commit comments

Comments
 (0)