mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
ci: cache datadog-ci (#9702)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Upload tests to datadog
|
name: Upload tests to Datadog
|
||||||
if: always()
|
if: always()
|
||||||
inputs:
|
inputs:
|
||||||
api-key:
|
api-key:
|
||||||
@@ -7,8 +7,26 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set work dir
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
WORK_DIR=${{ runner.temp }}/datadog-ci
|
||||||
|
mkdir -p $WORK_DIR
|
||||||
|
echo "WORK_DIR=$WORK_DIR" >> $GITHUB_ENV
|
||||||
|
# The npm install was taking 30s to 1m, accounting for 20+% of the total
|
||||||
|
# job time.
|
||||||
|
- name: Cache datadog-ci
|
||||||
|
uses: buildjet/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
${{ env.WORK_DIR }}
|
||||||
|
key: datadog-ci-${{ runner.os }}
|
||||||
|
restore-keys: |
|
||||||
|
datadog-ci-${{ runner.os }}-
|
||||||
|
datadog-ci-
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
cd ${{ env.WORK_DIR }}
|
||||||
owner=${{ github.repository_owner }}
|
owner=${{ github.repository_owner }}
|
||||||
echo "owner: $owner"
|
echo "owner: $owner"
|
||||||
if [[ $owner != "coder" ]]; then
|
if [[ $owner != "coder" ]]; then
|
||||||
@@ -20,8 +38,8 @@ runs:
|
|||||||
echo "No API key provided, skipping..."
|
echo "No API key provided, skipping..."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
npm install -g @datadog/datadog-ci@2.10.0
|
npm install @datadog/datadog-ci@2.10.0
|
||||||
datadog-ci junit upload --service coder ./gotests.xml \
|
npm x -- datadog-ci junit upload --service coder ./gotests.xml \
|
||||||
--tags os:${{runner.os}} --tags runner_name:${{runner.name}}
|
--tags os:${{runner.os}} --tags runner_name:${{runner.name}}
|
||||||
env:
|
env:
|
||||||
DATADOG_API_KEY: ${{ inputs.api-key }}
|
DATADOG_API_KEY: ${{ inputs.api-key }}
|
||||||
|
|||||||
Reference in New Issue
Block a user