Skip to content

Commit b84f930

Browse files
authored
Update rust.yml
Signed-off-by: Joe McCain III <[email protected]>
1 parent adf28fe commit b84f930

File tree

1 file changed

+49
-17
lines changed

1 file changed

+49
-17
lines changed

.github/workflows/rust.yml

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,61 @@
11
name: Rust
22

3+
env:
4+
CARGO_TERM_COLOR: always
5+
36
on:
7+
pull_request:
8+
branches: [ "main", "master", "prod" ]
9+
tags: [ "v*.*.*" ]
410
push:
5-
tags:
6-
- v*.*.*
11+
branches: [ "main", "master", "prod" ]
12+
tags: [ "v*.*.*" ]
713
schedule:
8-
- cron: '30 9 * * 5'
14+
- cron: "30 9 * * *"
915
workflow_dispatch:
10-
11-
env:
12-
CARGO_TERM_COLOR: always
13-
CARGO_REGISTRY_TOKEN: ${CARGO_REGISTRY_TOKEN}
16+
inputs:
17+
publish:
18+
default: true
19+
description: 'Publish'
20+
required: true
21+
type: boolean
1422

1523
jobs:
16-
login:
24+
build:
25+
name: Build and Test
1726
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
toolchain:
30+
- stable
31+
- nightly
1832
steps:
19-
- uses: actions/checkout@v3
20-
- name: Login
21-
run: cargo login ${CARGO_REGISTRY_TOKEN}
22-
build:
33+
- uses: actions/checkout@v3
34+
- name: setup
35+
run: rustup default ${{ matrix.toolchain }}
36+
- run: cargo build --release -v --workspace
37+
- run: cargo test --all --all-features --release -v
38+
features:
39+
if: ${{ github.event.inputs.publish }}
40+
name: Features
41+
needs: build
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
package:
46+
- algae-graph
47+
- algae-merkle
48+
- algae-mmr
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Publish (${{matrix.package}})
52+
run: cargo publish --all-features -v -p ${{ matrix.package }} --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
53+
publish:
54+
if: ${{ github.event.inputs.publish }}
55+
name: Publish
56+
needs: features
2357
runs-on: ubuntu-latest
2458
steps:
25-
- uses: actions/checkout@v3
26-
- name: Build
27-
run: cargo build --release --verbose --workspace
28-
- name: Test
29-
run: cargo test --all-features --release --verbose
59+
- uses: actions/checkout@v3
60+
- name: Publish (algae)
61+
run: cargo publish --all-features -v -p algae --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)