Skip to content

Commit 313cf9f

Browse files
authored
ci: remove toolchain adjustments (#2484)
* chore(scripts): remove toolchain adjustments * ci: remove toolchain adjustments * ci: add init composite action * ci: update workflow to use init action * ci: update to use container for step only * ci: update to use container for steps * ci: update image access * ci: update entrypoint * ci: update container args * ci: use container step for clippy job * ci: restore checkout * ci: update image * ci: update clippy job syntax * ci: improve initialize step name * ci: attempt to resolve clippy env variable * ci: merge clippy job via matrix * ci: update clippy-examples job to use run-container-command action * ci: update check job to use run-container-command action * ci: update fmt job to use run-container-command action * ci: set environment variable for check step * ci: update dylint jobs to use run-container-command action * ci: update build jobs to use run-container-command action * ci: update needs for example docs after merging via matrix * ci: remove test job partitioning due to switching to run-container-command * ci: fix alignment * ci: update test-docs job to use run-container-command action * ci: fix alignment * ci: update test-linting job to use run-container-command action * ci: update docs job to use run-container-command action * ci: update example-test job to remove partition and use run-container-command action * ci: update examples-test-mapping job to use run-container-command action * ci: update examples-custom-test job to use run-container-command action * ci: update examples-contract-build-riscv job by removing partioning and to use run-container-command action * ci: update examples-docs to use run-container-command action * ci: update fuzz test to use run-container-command action * ci: remove container requirement from submit-contract-sizes job * ci: remove leftover partitioning option from examples-test job * ci: fix syntax issue in build::RISCV job * ci: remove set_name job after image defined in composite action * ci: remove cargo_incremental overrides * ci: improve init action * ci: improve run-container-command action * ci: remove rust info after moved to reusable action * ci: attempt inputs image workaround * ci: accept defeat * ci: add additional cache key for matrix usage * ci: output image environment info as first step * ci: use relative path to enable proper caching between runner (host) and container ci: add github.workspace prefix to cache path, so that artifacts created within the container run can be cached ci: fix artifact name ci: remove unnecessary step * ci: adapt cache paths based on host/runner vs container * ci: use stable image * ci: update initialize runner action * ci: update run container command action * ci: update image used by run-container-command action * ci: attempt process-contract-sizes job fix * docs: update changelog * ci: attempt process-contract-sizes job fix * ci: use github.run_id instead of branch name Branch name may contain /, breaking file names. * ci: extract cargo contract version from environment for use in submit-contract-sizes job * ci: adjust syntax for outputting cargo-contract version * ci: remove leftover environment variable definition
1 parent 5dc1624 commit 313cf9f

File tree

6 files changed

+515
-628
lines changed

6 files changed

+515
-628
lines changed

.github/init/action.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Initialize Runner
2+
description: |
3+
This action initializes a runner/worker for use in other actions by maximizing build space and initializing caching
4+
for Rust/Cargo projects.
5+
6+
inputs:
7+
maximize-space:
8+
description: Whether to maximise build space by removing unnecessary software by default. Defaults to true.
9+
default: 'true'
10+
cache:
11+
description: Whether to cache Rust/cargo projects.
12+
cache-all-crates:
13+
description: Whether all crates should be cached, or only dependent crates. Defaults to true.
14+
default: 'true'
15+
cache-directories:
16+
description: Additional non-workspace directories to be cached, separated by newlines.
17+
cache-on-failure:
18+
description: Cache even if the build fails. Defaults to false.
19+
default: 'false'
20+
cache-key:
21+
description: An additional optional key to be added. Useful for jobs utilizing a matrix.
22+
23+
runs:
24+
using: composite
25+
26+
steps:
27+
- name: Maximize build space
28+
uses: AdityaGarg8/remove-unwanted-software@v5
29+
if: ${{ inputs.maximize-space == 'true' }}
30+
with:
31+
remove-android: 'true'
32+
remove-codeql: 'true'
33+
remove-docker-images: 'true'
34+
remove-dotnet: 'true'
35+
remove-haskell: 'true'
36+
37+
- name: Cache Rust/Cargo projects and dependencies
38+
uses: Swatinem/rust-cache@v2
39+
if: ${{ inputs.cache == 'true' }}
40+
with:
41+
cache-all-crates: ${{ inputs.cache-all-crates }}
42+
cache-directories: ${{ inputs.cache-directories }}
43+
cache-on-failure: ${{ inputs.cache-on-failure }}
44+
key: ${{ inputs.cache-key }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Run Container Command
2+
description: |
3+
This action runs a specified command within a container using the `useink/ci` image.
4+
5+
inputs:
6+
command:
7+
description: The command to be run within a container.
8+
required: true
9+
10+
runs:
11+
using: composite
12+
13+
steps:
14+
- name: Run command in container
15+
# Image can be edited at https://github.com/use-ink/docker-images
16+
uses: docker://useink/ci
17+
env:
18+
# Update the target directory used within the container to one which is within the path mounted to the host
19+
# runner workspace path. Required for effective caching.
20+
CARGO_TARGET_DIR: "/github/workspace/${{ env.CARGO_TARGET_DIR }}"
21+
with:
22+
entrypoint: /bin/bash
23+
args: -c "${{ inputs.command }}"

0 commit comments

Comments
 (0)