@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 03:37 UTC

next
yml 131 lines 4.93 KB
Raw
1 name: 'Setup Node.js, pnpm, Bun from mise.lock'
2 description: 'Sets up the mise-locked toolchain with enterprise-allowlisted actions'
3
4 inputs:
5 node-version:
6 description: 'Node.js version to use. Defaults to mise.lock'
7 required: false
8 default: ''
9 enable-caching:
10 description: 'Enable pnpm/tool cache'
11 required: false
12 default: 'true'
13 enable-turbo-cache:
14 description: 'Cache .turbo build outputs'
15 required: false
16 default: 'false'
17 cache-save:
18 description: >-
19 Persist pnpm/turbo caches in the post-job phase. Set to 'false' on runs
20 whose caches other branches cannot restore (e.g. pull_request runs) to
21 skip the post-job save and avoid evicting default-branch caches.
22 required: false
23 default: 'true'
24
25 outputs:
26 node-version:
27 description: 'The installed Node.js version'
28 value: ${{ steps.versions.outputs.node }}
29 bun-version:
30 description: 'The installed Bun version'
31 value: ${{ steps.versions.outputs.bun }}
32 pnpm-version:
33 description: 'The installed pnpm version'
34 value: ${{ steps.versions.outputs.pnpm }}
35
36 runs:
37 using: 'composite'
38 steps:
39 - name: Install mise CLI
40 shell: bash
41 run: bash "$GITHUB_ACTION_PATH/../../scripts/install-mise.sh"
42
43 - name: Resolve mise-locked versions
44 id: tool-versions
45 shell: bash
46 env:
47 NODE_VERSION: ${{ inputs.node-version }}
48 run: |
49 resolver="$GITHUB_ACTION_PATH/../../scripts/read-mise-lock-version.sh"
50 node_version="$NODE_VERSION"
51
52 if [[ -z "$node_version" ]]; then
53 node_version=$(bash "$resolver" node)
54 fi
55
56 echo "node=$node_version" >> "$GITHUB_OUTPUT"
57 echo "pnpm=$(bash "$resolver" pnpm)" >> "$GITHUB_OUTPUT"
58
59 - name: Setup Node.js
60 uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
61 with:
62 node-version: ${{ steps.tool-versions.outputs.node }}
63
64 - name: Setup Bun
65 shell: bash
66 run: |
67 mise install bun
68 dirname "$(mise which bun)" >> "$GITHUB_PATH"
69
70 - name: Setup pnpm
71 uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
72 with:
73 version: ${{ steps.tool-versions.outputs.pnpm }}
74 run_install: false
75
76 - name: Resolve pnpm store path and Node version
77 if: inputs.enable-caching == 'true'
78 id: pnpm-store
79 shell: bash
80 run: |
81 echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
82 echo "NODE_VERSION=$(node --version | sed 's/^v//')" >> "$GITHUB_OUTPUT"
83
84 - name: Cache pnpm store
85 if: inputs.enable-caching == 'true' && inputs.cache-save == 'true'
86 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
87 with:
88 path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
89 key: ${{ runner.os }}-node${{ steps.pnpm-store.outputs.NODE_VERSION }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
90 restore-keys: |
91 ${{ runner.os }}-node${{ steps.pnpm-store.outputs.NODE_VERSION }}-pnpm-store-
92
93 - name: Restore pnpm store (read-only)
94 if: inputs.enable-caching == 'true' && inputs.cache-save != 'true'
95 uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
96 with:
97 path: ${{ steps.pnpm-store.outputs.STORE_PATH }}
98 key: ${{ runner.os }}-node${{ steps.pnpm-store.outputs.NODE_VERSION }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
99 restore-keys: |
100 ${{ runner.os }}-node${{ steps.pnpm-store.outputs.NODE_VERSION }}-pnpm-store-
101
102 - name: Cache turbo build outputs
103 if: inputs.enable-caching == 'true' && inputs.enable-turbo-cache == 'true' && inputs.cache-save == 'true'
104 uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
105 with:
106 path: .turbo/cache
107 # Keyed per job: concurrent jobs save different task graphs under the
108 # same commit, and actions/cache is first-writer-wins on exact keys.
109 # The per-commit suffix is intentional even though it never exact-hits:
110 # the turbo cache accumulates, so every save must use a fresh key and
111 # readers match through the restore-keys prefix.
112 key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
113 restore-keys: |
114 ${{ runner.os }}-turbo-${{ github.job }}-
115
116 - name: Restore turbo build outputs (read-only)
117 if: inputs.enable-caching == 'true' && inputs.enable-turbo-cache == 'true' && inputs.cache-save != 'true'
118 uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
119 with:
120 path: .turbo/cache
121 key: ${{ runner.os }}-turbo-${{ github.job }}-${{ github.sha }}
122 restore-keys: |
123 ${{ runner.os }}-turbo-${{ github.job }}-
124
125 - name: Report versions
126 id: versions
127 shell: bash
128 run: |
129 echo "node=$(node --version | sed 's/^v//')" >> "$GITHUB_OUTPUT"
130 echo "bun=$(bun --revision)" >> "$GITHUB_OUTPUT"
131 echo "pnpm=$(pnpm --version)" >> "$GITHUB_OUTPUT"