-
Notifications
You must be signed in to change notification settings - Fork 64
132 lines (129 loc) · 4.21 KB
/
pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Unified CI/CD
on:
pull_request:
branches: [main]
push:
branches: [main]
env:
IROHA_GIT: https://github.com/hyperledger-iroha/iroha.git
IROHA_REV: daa2d50fbe288aed1231c6f45c853698435477d6
jobs:
prep-crypto-wasm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: prep-cache
with:
path: |
prep/crypto-wasm
key: ${{ runner.os }}-${{ hashFiles('crypto-wasm/*', 'etc/task-prep-crypto-wasm.ts') }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
if: steps.prep-cache.outputs.cache-hit != 'true'
with:
cache: 'false'
toolchain: 'nightly-2024-09-09,stable'
target: 'wasm32-unknown-unknown'
components: rust-src
- uses: jetli/[email protected]
if: steps.prep-cache.outputs.cache-hit != 'true'
with:
version: 'v0.13.1'
- uses: denoland/setup-deno@v2
if: steps.prep-cache.outputs.cache-hit != 'true'
with:
deno-version: v2.x
- name: Build packages
if: steps.prep-cache.outputs.cache-hit != 'true'
run: deno task prep:crypto-wasm
prep-iroha:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: prep-cache
with:
path: |
prep/iroha
key: ${{ runner.os }}-${{ env.IROHA_GIT }}-${{ env.IROHA_REV }}
- uses: actions-rust-lang/setup-rust-toolchain@v1
if: steps.prep-cache.outputs.cache-hit != 'true'
with:
toolchain: 'nightly-2024-09-09'
target: 'wasm32-unknown-unknown'
components: rust-src
cache: 'false'
- uses: denoland/setup-deno@v2
if: steps.prep-cache.outputs.cache-hit != 'true'
with:
deno-version: v2.x
- name: Prepare Iroha artifacts
if: steps.prep-cache.outputs.cache-hit != 'true'
run: |
deno task prep:iroha --git $IROHA_GIT --git-rev $IROHA_REV
deno task prep:iroha:build
check-only:
if: github.event_name == 'pull_request'
needs: [prep-iroha, prep-crypto-wasm]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ env.IROHA_GIT }}-${{ env.IROHA_REV }}
path: |
prep/iroha
- uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ hashFiles('crypto-wasm/*', 'etc/task-prep-crypto-wasm.ts') }}
path: |
prep/crypto-wasm
- uses: denoland/setup-deno@v2
with:
deno-version: v2.2.x
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Enable pnpm via Corepack
run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable pnpm
- run: deno task ok
check-and-publish:
if: github.event_name == 'push'
needs: [prep-iroha, prep-crypto-wasm]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ env.IROHA_GIT }}-${{ env.IROHA_REV }}
path: |
prep/iroha
- uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ hashFiles('crypto-wasm/*', 'etc/task-prep-crypto-wasm.ts') }}
path: |
prep/crypto-wasm
- uses: denoland/setup-deno@v2
with:
deno-version: v2.2.x
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Enable pnpm via Corepack
run: |
echo "Before: corepack version => $(corepack --version || echo 'not installed')"
npm install -g corepack@latest
echo "After : corepack version => $(corepack --version)"
corepack enable pnpm
- run: deno task publish