Skip to content

Commit 2f8bb64

Browse files
authored
ci: various improvements (#184)
1 parent 4f81605 commit 2f8bb64

File tree

32 files changed

+83128
-27906
lines changed

32 files changed

+83128
-27906
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
required: false
1313
type: string
1414
default: "false"
15+
release_only:
16+
description: Only run the release job
17+
required: false
18+
type: boolean
19+
default: false
1520
verbosity:
1621
description: The verbosity level to use
1722
required: false
@@ -46,6 +51,7 @@ jobs:
4651
uses: input-output-hk/catalyst-forge/actions/install@master
4752
if: ${{ inputs.forge_version != 'local' }}
4853
with:
54+
enable_caching: "true"
4955
version: ${{ inputs.forge_version }}
5056
- name: Install Local Forge
5157
id: install-local
@@ -78,62 +84,57 @@ jobs:
7884
check:
7985
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
8086
needs: [discover]
81-
if: (fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$'] != null) && !failure() && !cancelled()
87+
if: (fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$'] != null) && (inputs.release_only == false) && !failure() && !cancelled()
8288
with:
8389
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$']) }}
8490
forge_version: ${{ inputs.forge_version }}
8591
local: ${{ inputs.local }}
92+
skip_output: true
8693
verbosity: ${{ inputs.verbosity }}
87-
secrets:
88-
earthly_token: ${{ secrets.earthly_token }}
8994

9095
build:
9196
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
9297
needs: [discover, check]
93-
if: (fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$'] != null) && !failure() && !cancelled()
98+
if: (fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$'] != null) && (inputs.release_only == false) && !failure() && !cancelled()
9499
with:
95100
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$']) }}
96101
forge_version: ${{ inputs.forge_version }}
97102
local: ${{ inputs.local }}
103+
skip_output: true
98104
verbosity: ${{ inputs.verbosity }}
99-
secrets:
100-
earthly_token: ${{ secrets.earthly_token }}
101105

102106
package:
103107
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
104108
needs: [discover, check, build]
105-
if: (fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$'] != null) && !failure() && !cancelled()
109+
if: (fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$'] != null) && (inputs.release_only == false) && !failure() && !cancelled()
106110
with:
107111
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$']) }}
108112
forge_version: ${{ inputs.forge_version }}
109113
local: ${{ inputs.local }}
114+
skip_output: true
110115
verbosity: ${{ inputs.verbosity }}
111-
secrets:
112-
earthly_token: ${{ secrets.earthly_token }}
113116

114117
test:
115118
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
116119
needs: [discover, check, build, package]
117-
if: (fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$'] != null) && !failure() && !cancelled()
120+
if: (fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$'] != null) && (inputs.release_only == false) && !failure() && !cancelled()
118121
with:
119122
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$']) }}
120123
forge_version: ${{ inputs.forge_version }}
121124
local: ${{ inputs.local }}
125+
skip_output: true
122126
verbosity: ${{ inputs.verbosity }}
123-
secrets:
124-
earthly_token: ${{ secrets.earthly_token }}
125127

126128
nightly:
127129
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
128130
needs: [discover, check, build, package]
129-
if: (fromJson(needs.discover.outputs.earthfiles)['^nightly(-.*)?$'] != null) && !failure() && !cancelled() && inputs.nightly == true
131+
if: (fromJson(needs.discover.outputs.earthfiles)['^nightly(-.*)?$'] != null) && (inputs.release_only == false) && !failure() && !cancelled() && inputs.nightly == true
130132
with:
131133
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^nightly(-.*)?$']) }}
132134
forge_version: ${{ inputs.forge_version }}
133135
local: ${{ inputs.local }}
136+
skip_output: true
134137
verbosity: ${{ inputs.verbosity }}
135-
secrets:
136-
earthly_token: ${{ secrets.earthly_token }}
137138

138139
release:
139140
uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@master
@@ -144,8 +145,6 @@ jobs:
144145
forge_version: ${{ inputs.forge_version }}
145146
local: ${{ inputs.local }}
146147
verbosity: ${{ inputs.verbosity }}
147-
secrets:
148-
earthly_token: ${{ secrets.earthly_token }}
149148

150149
deploy:
151150
uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@master
@@ -156,8 +155,6 @@ jobs:
156155
forge_version: ${{ inputs.forge_version }}
157156
local: ${{ inputs.local }}
158157
verbosity: ${{ inputs.verbosity }}
159-
secrets:
160-
earthly_token: ${{ secrets.earthly_token }}
161158

162159
final:
163160
needs: [check, build, package, test, nightly, release, deploy]

.github/workflows/deploy.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ on:
2121
required: false
2222
type: string
2323
default: "info"
24-
secrets:
25-
earthly_token:
26-
description: Optional Earthly token used to login to Earthly cloud during local builds of Forge CLI
27-
required: false
2824

2925
env:
3026
CONTAINER: container
@@ -47,24 +43,16 @@ jobs:
4743
with:
4844
version: ${{ inputs.forge_version }}
4945
- name: Install Local Forge
46+
id: install-local
5047
uses: input-output-hk/catalyst-forge/actions/install-local@master
5148
if: ${{ inputs.forge_version == 'local' }}
52-
with:
53-
earthly_token: ${{ secrets.earthly_token }}
5449
- name: Check forge version
55-
id: local
56-
run: |
57-
forge version
58-
59-
if [[ "${{ inputs.forge_version }}" == "local" ]]; then
60-
echo "skip=true" >> $GITHUB_OUTPUT
61-
else
62-
echo "skip=false" >> $GITHUB_OUTPUT
63-
fi
50+
run: forge version
6451
- name: Setup CI
6552
uses: input-output-hk/catalyst-forge/actions/setup@master
6653
with:
67-
skip_earthly: ${{ steps.local.outputs.skip }}
54+
skip_earthly_install: ${{ inputs.forge_version == 'local' && steps.install-local.outputs.cache-hit == false }}
55+
skip_earthly_satellite: ${{ inputs.forge_version == 'local' && steps.install-local.outputs.cache-hit == false }}
6856
- name: Deploy
6957
uses: input-output-hk/catalyst-forge/actions/run@master
7058
with:

.github/workflows/dogfood.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ jobs:
1818
with:
1919
forge_version: local
2020
verbosity: debug
21-
nightly: true
21+
nightly: true
22+
release_only: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}

.github/workflows/release.yml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ on:
2727
required: false
2828
type: string
2929
default: "info"
30-
secrets:
31-
earthly_token:
32-
description: Optional Earthly token used to login to Earthly cloud during local builds of Forge CLI
33-
required: false
3430
env:
3531
OUTPUT: ${{ github.workspace }}/output
3632

@@ -50,24 +46,16 @@ jobs:
5046
with:
5147
version: ${{ inputs.forge_version }}
5248
- name: Install Local Forge
49+
id: install-local
5350
uses: input-output-hk/catalyst-forge/actions/install-local@master
5451
if: ${{ inputs.forge_version == 'local' }}
55-
with:
56-
earthly_token: ${{ secrets.earthly_token }}
5752
- name: Check forge version
58-
id: local
59-
run: |
60-
forge version
61-
62-
if [[ "${{ inputs.forge_version }}" == "local" ]]; then
63-
echo "skip=true" >> $GITHUB_OUTPUT
64-
else
65-
echo "skip=false" >> $GITHUB_OUTPUT
66-
fi
53+
run: forge version
6754
- name: Setup CI
6855
uses: input-output-hk/catalyst-forge/actions/setup@master
6956
with:
70-
skip_earthly: ${{ steps.local.outputs.skip }}
57+
skip_earthly_install: ${{ inputs.forge_version == 'local' && steps.install-local.outputs.cache-hit == false }}
58+
skip_earthly_satellite: ${{ inputs.forge_version == 'local' && steps.install-local.outputs.cache-hit == false }}
7159
- name: Release
7260
uses: input-output-hk/catalyst-forge/actions/run@master
7361
with:

.github/workflows/run.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ on:
1616
required: false
1717
type: string
1818
default: "false"
19+
skip_output:
20+
description: Skip outputting any images or artifacts
21+
required: false
22+
type: string
23+
default: "false"
1924
target_args:
2025
description: Extra arguments to pass to the target (if command is "run")
2126
required: false
@@ -26,10 +31,6 @@ on:
2631
required: false
2732
type: string
2833
default: "info"
29-
secrets:
30-
earthly_token:
31-
description: Optional Earthly token used to login to Earthly cloud during local builds of Forge CLI
32-
required: false
3334

3435
jobs:
3536
run:
@@ -50,12 +51,8 @@ jobs:
5051
id: install-local
5152
uses: input-output-hk/catalyst-forge/actions/install-local@master
5253
if: ${{ inputs.forge_version == 'local' }}
53-
with:
54-
earthly_token: ${{ secrets.earthly_token }}
5554
- name: Check forge version
56-
id: local
57-
run: |
58-
forge version
55+
run: forge version
5956
- name: Setup CI
6057
uses: input-output-hk/catalyst-forge/actions/setup@master
6158
with:
@@ -67,6 +64,7 @@ jobs:
6764
command: run
6865
args: ${{ matrix.earthfile }}
6966
local: ${{ inputs.local }}
67+
skip_output: ${{ inputs.skip_output }}
7068
target_args: ${{ inputs.target_args }}
7169
verbosity: ${{ inputs.verbosity }}
7270
env:

actions/install/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Install
22
description: Install Forge CLI
33
inputs:
4+
enable_caching:
5+
description: Enable caching for faster subsequent installations
6+
required: false
7+
default: "false"
48
github_token:
59
description: Github token for querying the API
610
required: false

0 commit comments

Comments
 (0)