-
Notifications
You must be signed in to change notification settings - Fork 15
42 lines (41 loc) · 1.23 KB
/
run_tests.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
on:
workflow_call:
inputs:
version:
required: false
type: string
default: "6.4.0"
package:
required: false
type: string
default: "free"
secrets:
FA_NPM_KEY:
required: false
description: FontAwesome NPM Key
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v3
id: load-cache
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- run: |
if [ "${{ inputs.package }}" != "free" ]; then \
printf "@fortawesome:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=${{ secrets.FA_NPM_KEY }}" > .npmrc; \
fi
if [ "${{ inputs.version }}" != "6.4.0" ] || [ "${{ inputs.package }}" != "free" ]; then \
npm i --no-save @fortawesome/fontawesome-${{ inputs.package }}@${{ inputs.version }}; \
fi
if [ "${{ inputs.package }}" != "free" ]; then \
rm .npmrc; \
fi
- run: npm test
env:
FA_TEST_PACKAGE: ${{ inputs.package }}