This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
generated from insightsengineering/r.pkg.template
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (96 loc) · 3.29 KB
/
verdepcheck.yaml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
name: Dependency Test 🔢
on:
workflow_call:
secrets:
GITHUB_TOKEN:
description: |
Github token with read access to repositories, required for dependencies installation
required: false
GCHAT_WEBHOOK:
description: |
Google Chat webhook to send failure notifications
required: false
inputs:
check-args:
description: Additional check arguments.
required: false
default: ""
type: string
build-args:
description: Additional build arguments.
required: false
default: ""
type: string
strategy:
description: |
Strategy to test package dependencies. One of: min_isolate, min_cohort, release, max.
required: true
type: string
additional-env-vars:
description: |
Extra environment variables, as a 'key=value' pair, with each pair on a new line.
Example usage:
additional-env-vars: |
ABC=123
XYZ=456
required: false
default: ""
type: string
jobs:
dependency-test:
name: Dependency Test 🔢
runs-on: ubuntu-latest
if: >
!contains(github.event.commits[0].message, '[skip dependency-test]')
&& github.event.pull_request.draft == false
container:
image: ghcr.io/insightsengineering/rstudio:latest
steps:
- name: Setup token 🔑
id: github-token
run: |
if [ "${{ secrets.GITHUB_TOKEN }}" == "" ]; then
echo "GITHUB_TOKEN is empty. Substituting it with GITHUB_TOKEN."
echo "token=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_OUTPUT
else
echo "Using GITHUB_TOKEN."
echo "token=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Checkout Code 🛎
uses: actions/checkout@v4
- name: Normalize variables 📏
run: |
strategy="${{ inputs.strategy }}"
echo "strategy=${strategy:-release}" >> $GITHUB_ENV
echo "gchat_webhook=${{ secrets.GCHAT_WEBHOOK }}" >> $GITHUB_ENV
shell: bash
- name: Dependency Test - ${{ env.strategy }} 🔢
id: verdepcheck
uses: insightsengineering/r-verdepcheck-action@main
with:
github-token: ${{ steps.github-token.outputs.token }}
check-args: ${{ inputs.check-args }}
build-args: ${{ inputs.build-args }}
additional-env-vars: ${{ inputs.additional-env-vars }}
strategy: ${{ env.strategy }}
- name: GChat notification 🔔
if: (failure() || cancelled()) && steps.verdepcheck.outcome != 'success' && env.gchat_webhook != ''
uses: insightsengineering/google-chat-notification@master
with:
name: ${{ github.event.repository.name }} - Dependency Test - ${{ env.strategy }}
url: ${{ secrets.GCHAT_WEBHOOK }}
status: ${{ job.status }}
- name: Upload lock file ⤴️
if: always()
uses: actions/upload-artifact@v3
with:
name: "lock-file-${{ env.strategy }}"
path: pkg.lock
- name: Upload output file ⤴️
if: always()
uses: actions/upload-artifact@v3
with:
name: "res-${{ env.strategy }}"
path: res.RDS