-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (71 loc) · 2.42 KB
/
Copy pathcode-verify.yml
File metadata and controls
82 lines (71 loc) · 2.42 KB
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
name: Code verify
concurrency:
group: code-PR-verify-${{ github.event.pull_request.number }}
cancel-in-progress: true
on:
pull_request:
paths:
- "code/**"
- ".github/workflows/code*"
env:
NEXT_PUBLIC_API_ENDPOINT: ${{ vars.NEXT_PUBLIC_API_ENDPOINT }}
NEXT_PUBLIC_API_ENDPOINT_HUB_NAME: ${{ vars.NEXT_PUBLIC_API_ENDPOINT_HUB_NAME }}
BACKEND_ENDPOINT: "http://weavejs-backend"
jobs:
unit-tests:
name: Code / Verify
timeout-minutes: 60
runs-on: ubuntu-24.04
env:
ASDF_BRANCH_VERSION: 0.18.0
steps:
- name: Checkout / Branch Head
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: NPM / Setup Dependencies Cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: asdf / Setup Dependencies Cache
uses: actions/cache@v4
id: asdf-cache
with:
path: ~/.asdf/data
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-
- name: Save tool-versions content
run: |
{
echo "TOOL_VERSIONS<<EOF"
cat code/.tool-versions
echo "EOF"
} >> "$GITHUB_ENV"
- name: NPM / Setup asdf environment
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302 # v4.0.0
# https://github.com/asdf-vm/actions/issues/356
if: steps.asdf-cache.outputs.cache-hit != 'true'
with:
tool_versions: ${{ env.TOOL_VERSIONS }}
asdf_version: ${{ env.ASDF_BRANCH_VERSION }}
- name: NPM / Create Cache Folders
run: |
mkdir -p "$HOME"/.npm
mkdir -p "$HOME"/.asdf/data
- name: Create .env.production file
working-directory: code
run: |
touch .env.production
echo NEXT_PUBLIC_API_ENDPOINT=${{ env.NEXT_PUBLIC_API_ENDPOINT }} >> .env.production
echo NEXT_PUBLIC_API_ENDPOINT_HUB_NAME=${{ env.NEXT_PUBLIC_API_ENDPOINT_HUB_NAME }} >> .env.production
echo BACKEND_ENDPOINT=${{ env.BACKEND_ENDPOINT }} >> .env.production
cat .env.production
- name: NPM / Verify
working-directory: code
run: |
npm run verify