Skip to content

Commit 47e6630

Browse files
Sunset the Rust flavor of the project at specific Rust version
1 parent 108cc9f commit 47e6630

File tree

27 files changed

+244
-244
lines changed

27 files changed

+244
-244
lines changed

.github/actions/cache/action.yml

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@ inputs:
44
rustc:
55
description: Rustc version hash
66
required: true
7+
compiled:
8+
description: What should we do for the compilation cache? read, write, skip
9+
default: skip
10+
toolchain:
11+
description: What should we do for the toolchain cache? read, read-write, skip
12+
default: skip
713
variant:
814
description: Variant to distinguish different caches
9-
default: 'default'
10-
compiled:
11-
description: Should it restore, save, or skip compiled files?
12-
default: 'restore'
13-
index:
14-
description: Should it enable the index cache?
15-
default: 'true'
15+
default: default
1616

1717
outputs:
1818
compiled:
1919
description: Cache hit for compiled
20-
value: ${{ steps.compiled.outputs.cache-hit }}
21-
index:
22-
description: Cache hit for index
23-
value: ${{ steps.index.outputs.cache-hit }}
20+
value: ${{ steps.compiled-r.outputs.cache-hit }}
21+
toolchain:
22+
description: Cache hit for toolchain
23+
value: ${{ steps.toolchain-rw.outputs.cache-hit || steps.toolchain-r.outputs.cache-hit }}
2424

2525
runs:
2626
using: composite
2727
steps:
28-
- name: Cache dependencies registry
29-
id: index
30-
if: inputs.index == 'true' && inputs.compiled != 'save'
28+
- name: Configure toolchain cache
29+
id: toolchain-rw
30+
if: inputs.toolchain == 'read-write'
3131
uses: actions/cache@v3
3232
with:
3333
path: |
@@ -39,9 +39,23 @@ runs:
3939
restore-keys: |
4040
${{ runner.os }}-${{ inputs.rustc }}-cargo
4141
42-
- name: Restore compiled dependencies
43-
id: compiled
44-
if: inputs.compiled == 'restore'
42+
- name: Restore toolchain cache
43+
id: toolchain-r
44+
if: inputs.toolchain == 'read'
45+
uses: actions/cache/restore@v3
46+
with:
47+
path: |
48+
~/.cargo/bin/
49+
~/.cargo/registry/index/
50+
~/.cargo/registry/cache/
51+
~/.cargo/git/db/
52+
key: ${{ runner.os }}-${{ inputs.rustc }}-cargo-${{ hashFiles('**/Cargo.lock') }}
53+
restore-keys: |
54+
${{ runner.os }}-${{ inputs.rustc }}-cargo
55+
56+
- name: Restore compilation cache
57+
id: compiled-r
58+
if: inputs.compiled == 'read'
4559
uses: actions/cache/restore@v3
4660
with:
4761
path: target/
@@ -50,15 +64,15 @@ runs:
5064
${{ runner.os }}-${{ inputs.rustc }}-cargo-${{ inputs.variant }}
5165
${{ runner.os }}-${{ inputs.rustc }}-cargo-default
5266
53-
- name: Configure cleanup before cache save
54-
if: inputs.compiled == 'save'
67+
- name: Cleanup of compilation outputs
68+
if: inputs.compiled == 'write'
5569
shell: bash
5670
run: |
5771
find target \( -name 'coverage' -o -name 'incremental' \) -prune -type d -exec rm -rf {} \;
5872
find target \( -name 'libkct*' -o -name 'kct*' \) -prune -exec rm -rf {} \;
5973
60-
- name: Save compiled dependencies
61-
if: inputs.compiled == 'save'
74+
- name: Write compilation cache
75+
if: inputs.compiled == 'write'
6276
uses: actions/cache/save@v3
6377
with:
6478
path: target/

.github/dependabot.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
on: [workflow_call]
22

3-
name: Workflows baseline
3+
name: Warm-up caches
44

55
jobs:
6-
setup:
6+
toolchain:
77
runs-on: ubuntu-latest
88
timeout-minutes: 10
99
steps:
@@ -15,35 +15,60 @@ jobs:
1515
uses: actions-rs/toolchain@v1
1616
with:
1717
profile: minimal
18-
toolchain: stable
18+
toolchain: 1.89.0
1919
override: true
20-
components: rustfmt, clippy, llvm-tools
20+
components: rustfmt,clippy,llvm-tools
2121

2222
- name: Configure cache
2323
id: cache
2424
uses: ./.github/actions/cache
2525
with:
2626
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
27-
28-
- name: Compile project
29-
if: steps.cache.outputs.compiled != 'true'
30-
uses: actions-rs/cargo@v1
31-
with:
32-
command: build
27+
toolchain: read-write
3328

3429
- name: Install coverage tool
35-
if: steps.cache.outputs.index != 'true'
30+
if: steps.cache.outputs.toolchain != 'true'
3631
shell: bash
3732
run: which grcov || cargo install grcov
3833

3934
- name: Install cross compiler
40-
if: steps.cache.outputs.index != 'true'
35+
if: steps.cache.outputs.toolchain != 'true'
4136
shell: bash
4237
run: which cross || cargo install cross
4338

39+
project:
40+
runs-on: ubuntu-latest
41+
timeout-minutes: 10
42+
steps:
43+
- name: Checkout sources
44+
uses: actions/checkout@v3
45+
46+
- name: Install toolchain
47+
id: toolchain
48+
uses: actions-rs/toolchain@v1
49+
with:
50+
profile: minimal
51+
toolchain: 1.89.0
52+
override: true
53+
components: rustfmt,clippy,llvm-tools
54+
55+
- name: Configure cache
56+
id: cache
57+
uses: ./.github/actions/cache
58+
with:
59+
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
60+
toolchain: read
61+
compiled: read
62+
63+
- name: Compile project
64+
if: steps.cache.outputs.compiled != 'true'
65+
uses: actions-rs/cargo@v1
66+
with:
67+
command: build
68+
4469
- name: Save cache
4570
if: steps.cache.outputs.compiled != 'true'
4671
uses: ./.github/actions/cache
4772
with:
4873
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
49-
compiled: save
74+
compiled: write
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
on: [push]
1+
on: [push, workflow_call]
22

33
name: Code Quality
44

@@ -7,11 +7,11 @@ concurrency:
77
cancel-in-progress: true
88

99
jobs:
10-
base:
11-
uses: ./.github/workflows/base.yml
10+
caches:
11+
uses: ./.github/workflows/caches.yml
1212

1313
tests:
14-
needs: [base]
14+
needs: [caches]
1515
runs-on: ubuntu-latest
1616
timeout-minutes: 10
1717
steps:
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions-rs/toolchain@v1
2424
with:
2525
profile: minimal
26-
toolchain: stable
26+
toolchain: 1.89.0
2727
override: true
2828
components: llvm-tools
2929

@@ -33,7 +33,8 @@ jobs:
3333
with:
3434
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
3535
variant: coverage
36-
compiled: restore
36+
compiled: read
37+
toolchain: read
3738

3839
- name: Run tests
3940
uses: actions-rs/cargo@v1
@@ -46,7 +47,7 @@ jobs:
4647
args: --tests --workspace
4748

4849
- name: Install coverage tool
49-
if: steps.cache.outputs.index != 'true'
50+
if: steps.cache.outputs.toolchain != 'true'
5051
shell: bash
5152
run: which grcov || cargo install grcov
5253

@@ -68,10 +69,10 @@ jobs:
6869
with:
6970
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
7071
variant: coverage
71-
compiled: save
72+
compiled: write
7273

7374
style:
74-
needs: [base]
75+
needs: [caches]
7576
runs-on: ubuntu-latest
7677
timeout-minutes: 5
7778
steps:
@@ -83,14 +84,15 @@ jobs:
8384
uses: actions-rs/toolchain@v1
8485
with:
8586
profile: minimal
86-
toolchain: stable
87+
toolchain: 1.89.0
8788
override: true
88-
components: rustfmt, clippy
89+
components: rustfmt,clippy
8990

9091
- name: Configure cache
9192
uses: ./.github/actions/cache
9293
with:
9394
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
95+
toolchain: read
9496

9597
- name: Run cargo fmt
9698
uses: actions-rs/cargo@v1

.github/workflows/release.yml

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,3 @@
1-
# MIT License
2-
#
3-
# Copyright (c) 2020 Yaroslav Bolyukin
4-
#
5-
# Permission is hereby granted, free of charge, to any person obtaining a copy
6-
# of this software and associated documentation files (the "Software"), to deal
7-
# in the Software without restriction, including without limitation the rights
8-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
# copies of the Software, and to permit persons to whom the Software is
10-
# furnished to do so, subject to the following conditions:
11-
#
12-
# The above copyright notice and this permission notice shall be included in all
13-
# copies or substantial portions of the Software.
14-
#
15-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
# SOFTWARE.
22-
231
on:
242
push:
253
tags:
@@ -28,38 +6,11 @@ on:
286
name: Release
297

308
jobs:
31-
base:
32-
uses: ./.github/workflows/base.yml
33-
34-
test:
35-
needs: [base]
36-
runs-on: ubuntu-latest
37-
timeout-minutes: 5
38-
steps:
39-
- name: Checkout sources
40-
uses: actions/checkout@v3
41-
42-
- name: Install toolchain
43-
id: toolchain
44-
uses: actions-rs/toolchain@v1
45-
with:
46-
profile: minimal
47-
toolchain: stable
48-
override: true
49-
50-
- name: Restore cache
51-
uses: ./.github/actions/cache
52-
with:
53-
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
54-
55-
- name: Run tests
56-
uses: actions-rs/cargo@v1
57-
with:
58-
command: test
59-
args: --tests
9+
quality:
10+
uses: ./.github/workflows/quality.yml
6011

6112
release:
62-
needs: [test]
13+
needs: [quality]
6314
strategy:
6415
matrix:
6516
target:
@@ -130,21 +81,22 @@ jobs:
13081
with:
13182
target: ${{ matrix.target }}
13283
profile: minimal
133-
toolchain: stable
84+
toolchain: 1.89.0
13485
override: true
86+
components: llvm-tools
13587

13688
- name: Configure cache
13789
uses: ./.github/actions/cache
13890
with:
13991
rustc: ${{ steps.toolchain.outputs.rustc_hash }}
140-
compiled: skip
92+
toolchain: read-write
14193

14294
- name: Linux x86 cross compiler
14395
if: startsWith(matrix.target, 'i686-unknown-linux-')
14496
run: sudo apt install gcc-multilib
14597

14698
- name: ARM cross compiler
147-
if: startsWith(matrix.target, 'aarch64-unknown-linux-') && steps.cache.outputs.index != 'true'
99+
if: startsWith(matrix.target, 'aarch64-unknown-linux-') && steps.cache.outputs.toolchain != 'true'
148100
shell: bash
149101
run: which cross || cargo install cross
150102

0 commit comments

Comments
 (0)