This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
forked from asdf-vm/actions
-
Notifications
You must be signed in to change notification settings - Fork 0
213 lines (169 loc) · 4.6 KB
/
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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: Main workflow
on:
- pull_request
- push
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/[email protected]
with:
node-version: 20.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Retrieve yarn cache
uses: actions/cache@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: v1-${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
v1-${{ runner.os }}-yarn-
- name: Install npm packages
run: yarn --frozen-lockfile
- name: Check formatting
run: yarn fmt:check
- name: Check lint
run: yarn lint
- name: Check type
run: yarn typecheck
- name: Ensure out directories are up-to-date
if: runner.os == 'Linux'
shell: bash
run: |
yarn build
yarn fmt
if [ "$(git status --porcelain | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
asdf_is_installed:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: setup asdf
uses: ./setup
- name: asdf is available
run: |
echo ASDF_DIR=$ASDF_DIR
echo ASDF_DATA_DIR=$ASDF_DATA_DIR
echo PATH=$PATH
asdf --version
plugin_is_tested:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: ./plugin-test
with:
command: direnv --version
plugin: direnv
giturl: https://github.com/asdf-community/asdf-direnv.git
gitref: master
plugins_are_installed:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: ./plugins-add
with:
tool_versions: |
# tools wont be installed by this action, only plugins
elixir foo
nodejs bar
- run: |
asdf plugin list --urls --refs | grep elixir
asdf plugin list --urls --refs | grep nodejs
installing-plugins-already-installed-are-skiped:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: ./setup
- name: Add an asdf plugin
run: |
asdf plugin-add clusterctl https://github.com/pfnet-research/asdf-clusterctl.git
- uses: ./plugins-add
with:
tool_versions: |
# tools wont be installed by this action, only plugins
elixir foo
nodejs bar
# plugins already installed are here
clusterctl tako
- run: |
asdf plugin list --urls --refs | grep elixir
asdf plugin list --urls --refs | grep nodejs
asdf plugin list --urls --refs | grep clusterctl
tools_are_installed:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: setup asdf
uses: ./install
with:
before_install: echo asdf nodejs import-keyring
tool_versions: direnv 2.33.0
- run: direnv version
tools_current:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup asdf
uses: ./install
- name: Asdf current
id: current
uses: ./current
- name: Get the output
run: |
echo "${{ steps.current.outputs._raw }}"
echo "${{ steps.current.outputs._parsed }}"
echo "${{ steps.current.outputs.nodejs }}"