-
Notifications
You must be signed in to change notification settings - Fork 4
43 lines (41 loc) · 1.35 KB
/
reusable-examples.yml
File metadata and controls
43 lines (41 loc) · 1.35 KB
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
name: Reusable Examples Workflow
on:
workflow_call:
inputs:
target-branch:
description: 'Branch to checkout and test (defaults to the calling branch)'
required: false
type: string
default: ''
examples-command:
description: 'Examples command to execute'
required: false
type: string
default: 'cargo check --examples'
rust-version:
description: 'Rust version to use for examples'
required: false
type: string
default: 'stable'
secrets:
PIPELINE_GITHUB_APP_ID:
required: false
PIPELINE_GITHUB_APP_PRIVATE_KEY:
required: false
jobs:
examples:
runs-on: ubuntu-latest
if: (github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'ci/skip') && !contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) || github.event_name == 'schedule'
steps:
- uses: actions/checkout@v3
with:
repository: DataDog/datadog-api-client-rust
ref: ${{ inputs.target-branch || github.ref }}
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ inputs.rust-version }}
- uses: Swatinem/rust-cache@v2
- name: Check examples
run: ${{ inputs.examples-command }}
shell: bash