This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch refactor-actions
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/refactor-actions by this push:
new 7e91e3f89 try
7e91e3f89 is described below
commit 7e91e3f8919275fff30f8d37b574dcfa48f2ae29
Author: Xuanwo <[email protected]>
AuthorDate: Thu Oct 12 22:37:36 2023 +0800
try
Signed-off-by: Xuanwo <[email protected]>
---
.github/workflows/core.test.yml | 53 ----------------------
.../workflows/{core.build.yml => core_test.yml} | 51 +++++++++++++++++----
.github/workflows/test.yml | 18 +++-----
scripts/workflow_planner.py | 22 ++++-----
4 files changed, 58 insertions(+), 86 deletions(-)
diff --git a/.github/workflows/core.test.yml b/.github/workflows/core.test.yml
deleted file mode 100644
index 14d39663b..000000000
--- a/.github/workflows/core.test.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name: Core
-
-on:
- workflow_call:
- inputs:
- plan:
- required: true
- type: string
-
-jobs:
- core:
- name: ${{ matrix.cases.service }} / ${{ matrix.cases.setup }}
- runs-on: ${{ matrix.cases.os }}
- strategy:
- matrix:
- cases: ${{ fromJson(inputs.plan).cases }}
- steps:
- - uses: actions/checkout@v4
- - name: Setup Rust toolchain
- uses: ./.github/actions/setup
- with:
- need-nextest: true
- need-protoc: true
- need-rocksdb: true
-
- - name: Download
- uses: actions/download-artifact@v2
- with:
- name: core-test
- path: ./core/core-test.tar.zst
-
- - name: Test Core
- uses: ./.github/actions/test-core
- with:
- setup: ${{ matrix.cases.setup }}
- service: ${{ matrix.cases.service }}
diff --git a/.github/workflows/core.build.yml b/.github/workflows/core_test.yml
similarity index 57%
rename from .github/workflows/core.build.yml
rename to .github/workflows/core_test.yml
index 0e19c984b..df04e405e 100644
--- a/.github/workflows/core.build.yml
+++ b/.github/workflows/core_test.yml
@@ -15,20 +15,25 @@
# specific language governing permissions and limitations
# under the License.
+name: Core
+
on:
workflow_call:
inputs:
- plan:
+ os:
+ required: true
+ type: string
+ cases:
+ required: true
+ type: string
+ features:
required: true
type: string
jobs:
build:
- name: ${{ matrix.os }}
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- include: ${{ fromJson(inputs.plan).matrix }}
+ name: ${{ inputs.os }}
+ runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
@@ -50,10 +55,38 @@ jobs:
shell: bash
working-directory: core
run: |
- cargo nextest archive --features ${{ matrix.features }}
--archive-file ./core-test.tar.zst
+ cargo nextest archive --features ${{ inputs.features }}
--archive-file ./core-test.tar.zst
- name: Upload
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ inputs.os }}-core-test
+ path: ./core/${{ inputs.os }}-core-test.tar.zst
+
+ core:
+ name: ${{ matrix.cases.service }} / ${{ matrix.cases.setup }}
+ needs: [build]
+ runs-on: ${{ inputs.os }}
+ strategy:
+ matrix:
+ cases: ${{ fromJson(inputs.cases) }}
+ steps:
+ - uses: actions/checkout@v4
+ - name: Setup Rust toolchain
+ uses: ./.github/actions/setup
with:
- name: core-test
+ need-nextest: true
+ need-protoc: true
+ need-rocksdb: true
+
+ - name: Download
+ uses: actions/download-artifact@v3
+ with:
+ name: ${{ inputs.os }}-core-test
path: ./core/core-test.tar.zst
+
+ - name: Test Core
+ uses: ./.github/actions/test-core
+ with:
+ setup: ${{ matrix.cases.setup }}
+ service: ${{ matrix.cases.service }}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index b12e677d5..dcf504712 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -55,19 +55,15 @@ jobs:
echo "plan=$PLAN" >> $GITHUB_OUTPUT
- core_build:
- name: core build
- needs: [plan]
- if: fromJson(needs.plan.outputs.plan).components.core
- uses: ./.github/workflows/core.build.yml
- with:
- plan: ${{ needs.plan.outputs.plan }}
-
core_test:
name: core
- needs: [plan, core_build]
+ needs: [plan]
if: fromJson(needs.plan.outputs.plan).components.core
- secrets: inherit
+ strategy:
+ matrix:
+ include: ${{ fromJson(needs.plan.outputs.plan).core }}
uses: ./.github/workflows/core.test.yml
with:
- plan: ${{ needs.plan.outputs.plan }}
+ os: ${{ matrix.os }}
+ cases: ${{ matrix.cases }}
+ features: ${{ matrix.features }}
diff --git a/scripts/workflow_planner.py b/scripts/workflow_planner.py
index 3f6b74ce5..9f73131ca 100755
--- a/scripts/workflow_planner.py
+++ b/scripts/workflow_planner.py
@@ -27,26 +27,22 @@ def plan(changed_files):
"services": {
"fs": True,
},
- "matrix": [
+ "core": [
{
"os": "ubuntu-latest",
"features": "services-fs,services-s3",
+ "cases": [{
+ "setup": "local-fs",
+ "service": "fs"
+ }]
},
{
"os": "windows-latest",
"features": "services-fs,services-s3",
- }
- ],
- "cases": [
- {
- "os": "ubuntu-latest",
- "setup": "local-fs",
- "service": "fs"
- },
- {
- "os": "windows-latest",
- "setup": "local-fs",
- "service": "fs"
+ "cases": [{
+ "setup": "local-fs",
+ "service": "fs"
+ }]
}
]
}