Skip to content

Commit bd80f00

Browse files
authored
Use cache in CI (#1074)
* Use cache in CI This sets up the action with cache. * Don't use cache for examples
1 parent 5f1ab4e commit bd80f00

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

.github/workflows/approved_status.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ jobs:
2626
app_id: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
2727
private_key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
2828
repository: DataDog/datadog-api-spec
29-
- name: Checkout code
30-
uses: actions/checkout@v2
3129
- name: Post PR review status check
3230
uses: DataDog/github-actions/[email protected]
3331
with:

.github/workflows/docs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
with:
1818
# Fetch all history for applying timestamps to every page
1919
fetch-depth: 0
2020

2121
- name: Set up Python
22-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v4
2323
with:
2424
python-version: "3.8"
25+
cache: "pip"
2526

2627
- name: Upgrade Python packaging tools
2728
run: pip install --disable-pip-version-check --upgrade pip setuptools wheel

.github/workflows/publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ jobs:
1010
name: Upload release
1111
runs-on: ubuntu-20.04
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1414
# Include all history and tags, needed for building the right version
1515
with:
1616
ref: ${{ github.event.release.tag_name }}
1717
fetch-depth: 0
1818

19-
- uses: actions/setup-python@v2
19+
- uses: actions/setup-python@v4
2020
name: Install Python
2121
with:
2222
python-version: "3.10"
23+
cache: "pip"
2324

2425
- name: Install pypa/build
2526
run: python -m pip install build --user

.github/workflows/test.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
app_id: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
2929
private_key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
30-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
3131
with:
3232
fetch-depth: 0
3333
ref: ${{ github.event.pull_request.head.sha }}
@@ -77,11 +77,12 @@ jobs:
7777
runs-on: ${{ matrix.platform }}
7878
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/')
7979
steps:
80-
- uses: actions/checkout@v2
80+
- uses: actions/checkout@v3
8181
- name: Set up Python ${{ matrix.python-version }}
82-
uses: actions/setup-python@v2
82+
uses: actions/setup-python@v4
8383
with:
8484
python-version: ${{ matrix.python-version }}
85+
cache: "pip"
8586
- name: Upgrade pip
8687
run: |
8788
python -m pip install --upgrade pip
@@ -96,9 +97,9 @@ jobs:
9697
runs-on: ubuntu-latest
9798
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/')
9899
steps:
99-
- uses: actions/checkout@v2
100+
- uses: actions/checkout@v3
100101
- name: Install Python
101-
uses: actions/setup-python@v2
102+
uses: actions/setup-python@v4
102103
with:
103104
python-version: "3.10"
104105
- name: Check examples
@@ -121,7 +122,7 @@ jobs:
121122
private_key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
122123
repository: DataDog/datadog-api-spec
123124
- name: Checkout code
124-
uses: actions/checkout@v2
125+
uses: actions/checkout@v3
125126
- name: Post status check
126127
uses: DataDog/github-actions/[email protected]
127128
with:

.github/workflows/test_integration.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
private_key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
4141
repository: DataDog/datadog-api-spec
4242
- name: Checkout code
43-
uses: actions/checkout@v2
43+
uses: actions/checkout@v3
4444
- name: Post pending status check
4545
if: github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')
4646
uses: DataDog/github-actions/[email protected]
@@ -50,9 +50,10 @@ jobs:
5050
status: pending
5151
context: integration
5252
- name: Set up Python 3.10
53-
uses: actions/setup-python@v2
53+
uses: actions/setup-python@v4
5454
with:
5555
python-version: "3.10"
56+
cache: "pip"
5657
- name: Upgrade pip
5758
run: |
5859
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)