-
Notifications
You must be signed in to change notification settings - Fork 22
66 lines (63 loc) · 1.93 KB
/
basic-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Basic CI Workflow
on:
workflow_call:
inputs:
module:
type: string
required: true
description: 'The name of sample project.'
language:
type: string
required: true
description: 'The programming language used by the sample project.'
with_oceanbase_container:
type: boolean
required: false
description: 'Whether to use a pre-deployed OceanBase container in CI workflow.'
default: true
oceanbase_image_tag:
type: string
required: false
description: 'The tag of OceanBase CE Docker image.'
concurrency:
group: basic-ci-${{ github.event.pull_request.number || github.ref }}-${{ inputs.module }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set Go env
if: ${{ inputs.language == 'golang' }}
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Setup Java env
if: ${{ inputs.language == 'java' }}
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'zulu'
cache: 'maven'
- name: Setup Python env
if: ${{ inputs.language == 'python' }}
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Setup Ruby env
if: ${{ inputs.language == 'ruby' }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
- name: Start OceanBase container
if: ${{ inputs.with_oceanbase_container }}
uses: oceanbase/setup-oceanbase-ce@v1
with:
network: 'host'
image_tag: ${{ inputs.oceanbase_image_tag || 'latest' }}
- name: Run sample for ${{ inputs.module }}
run: |
cd ${{ inputs.language }}/${{ inputs.module }} || exit
sh run.sh