-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
64 lines (64 loc) · 2.11 KB
/
action.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
name: 'Setup Jakt Environment'
description: 'Setup a Jakt environment and add the compiler to the PATH'
author: 'SerenityOS'
branding:
icon: box
color: purple
inputs:
revision:
description: 'The revision of Jakt to pull, defaults to latest on main'
default: 'main'
required: false
token:
description: 'Token used to pull from the Jakt repository'
default: ${{ github.token }}
required: false
cache:
description: "Enable cache, subsequent runs will be faster unless a new revision is downloaded"
default: false
required: false
outputs:
# FIXME: No idea why these aren't set, for now, $JAKT_COMPILER and $JAKT_RUNTIME will have to do.
jakt-hash:
description: 'Hash of the checked-out revision'
jakt-path:
description: 'Path to built jakt binary'
cache-hit:
description: 'Indicates whether the cache was hit'
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
shell: bash
working-directory: ${{ github.action_path }}
- run: node lib/jakt/check_cache.js
id: check_cache
env:
INPUT_CACHE: ${{ inputs.cache }}
INPUT_TOKEN: ${{ inputs.token }}
INPUT_REVISION: ${{ inputs.revision }}
shell: bash
working-directory: ${{ github.action_path }}
- uses: actions/cache@v3
if: ${{ inputs.cache }}
with:
path: ${{ runner.tool_cache }}/jakt
key: jakt-${{ runner.os }}-${{ runner.arch }}-${{ steps.check_cache.outputs.jakt-hash }}
restore-keys: jakt-${{ runner.os }}-${{ runner.arch }}
- uses: aminya/setup-cpp@v1
with:
llvm: 14.0.0
cmake: ${{ steps.check_cache.outputs.cache_hit != true }}
ninja: ${{ steps.check_cache.outputs.cache_hit != true }}
- run: node lib/jakt/main.js
if: ${{ steps.check_cache.outputs.cache_hit != true }}
id: build_jakt
env:
INPUT_CACHE: ${{ inputs.cache }}
INPUT_TOKEN: ${{ inputs.token }}
INPUT_REVISION: ${{ steps.check_cache.outputs.jakt-hash }}
shell: bash
working-directory: ${{ github.action_path }}