Skip to content

Commit aec59ae

Browse files
committed
Test local action
1 parent 5d1bb0c commit aec59ae

File tree

5 files changed

+59
-23
lines changed

5 files changed

+59
-23
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI setup
2+
3+
description: |
4+
Sets up the CI environment for the project.
5+
6+
inputs:
7+
ref:
8+
description: "The ref to checkout"
9+
required: false
10+
default: ${{ github.event.pull_request.head.sha || github.sha }}
11+
submodules-ssh-key:
12+
description: "The SSH key to private submodules to use for the checkout"
13+
required: false
14+
15+
runs:
16+
using: "composite"
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
ref: ${{ inputs.ref }}
22+
submodules: ${{ inputs.submodules-ssh-key && 'recursive' || false }}
23+
ssh-key: ${{ inputs.submodules-ssh-key }}
24+
25+
- name: Try checkout submodules to the same branch as main repo
26+
if: ${{ inputs.submodules-ssh-key }}
27+
run: |
28+
git submodule foreach '
29+
BRANCH=$(git -C $toplevel rev-parse --abbrev-ref HEAD);
30+
if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null; then
31+
git checkout "$BRANCH" && git pull origin "$BRANCH";
32+
fi;'
33+
shell: bash
34+
35+
- name: Show readme
36+
run: |
37+
cat ./packages/sdk-components-animation/private-src/README.md
38+
shell: bash

.github/workflows/fixtures-test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ jobs:
3030
BUILDER_HOST: ${{ inputs.builder-host }}
3131

3232
steps:
33-
- uses: actions/checkout@v4
33+
- uses: ./.github/actions/checkout
3434
with:
35-
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
35+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
36+
submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
3637

3738
- uses: ./.github/actions/ci-setup
3839

.github/workflows/main.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
runs-on: ubuntu-24.04-arm
2626

2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: ./.github/actions/checkout
2929
with:
30-
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
30+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
3131

3232
- uses: ./.github/actions/ci-setup
3333

@@ -49,13 +49,22 @@ jobs:
4949
- run: pnpm --filter=@webstudio-is/prisma-client build
5050
- run: pnpm -r typecheck
5151

52+
- uses: ./.github/actions/checkout
53+
with:
54+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
55+
submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
56+
57+
- run: |
58+
pnpm -r --filter='sdk-components-animation' typecheck
59+
5260
check-size:
5361
runs-on: ubuntu-latest
5462

5563
steps:
56-
- uses: actions/checkout@v4
64+
- uses: ./.github/actions/checkout
5765
with:
58-
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
66+
ref: ${{ github.event.pull_request.head.sha || github.sha }}
67+
submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
5968

6069
- uses: ./.github/actions/ci-setup
6170

.github/workflows/vercel-deploy-staging.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,13 @@ jobs:
3636
runs-on: ubuntu-latest
3737

3838
steps:
39-
- uses: actions/checkout@v4
39+
- uses: ./.github/actions/checkout
4040
with:
41-
ref: ${{ github.event.pull_request.head.sha || github.sha }} # HEAD commit instead of merge commit
42-
submodules: recursive
43-
ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
44-
45-
- name: Try checkout submodules to the same branch as main repo
46-
run: |
47-
git submodule foreach '
48-
BRANCH=$(git -C $toplevel rev-parse --abbrev-ref HEAD);
49-
if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null; then
50-
git checkout "$BRANCH" && git pull origin "$BRANCH";
51-
fi;'
52-
53-
- name: Show readme
54-
run: |
55-
cat ./packages/sdk-components-animation/private-src/README.md
41+
ref: ${{ github.sha }}
42+
submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
5643

5744
- uses: pnpm/action-setup@v4
45+
5846
- uses: actions/setup-node@v4
5947
with:
6048
node-version: 20

0 commit comments

Comments
 (0)