chore: Add snapshot workflow (#48)

* Add snapshot workflow

* Combine snapshot and test workflow

* Renaming things

* Fixes
This commit is contained in:
Anatolios Laskaris 2023-01-10 11:20:21 +02:00 committed by GitHub
parent 461893befd
commit b66707fdaa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,23 +10,45 @@ on:
description: "git ref to checkout to"
type: string
default: "master"
env:
RUST_TEST_THREADS: 1
outputs:
cargo-version:
description: "Cargo snapshot version"
value: ${{ jobs.tests.outputs.version }}
jobs:
marine-rs-sdk-test:
tests:
name: "Run tests"
runs-on: builder
outputs:
version: "${{ steps.snapshot.outputs.version }}"
permissions:
contents: read
id-token: write
steps:
- name: Checkout to marine-rs-sdk-test
- name: Checkout to repository
uses: actions/checkout@v3
with:
repository: "fluencelabs/marine-rs-sdk-test"
repository: fluencelabs/marine-rs-sdk-test
ref: ${{ inputs.ref }}
- name: Setup rust toolchain
- name: Import secrets
uses: hashicorp/vault-action@v2.4.3
with:
url: https://vault.fluence.dev
path: jwt/github
role: ci
method: jwt
jwtGithubAudience: "https://github.com/fluencelabs"
jwtTtl: 300
exportToken: false
secrets: |
kv/cargo-registry/users/ci token | CARGO_REGISTRIES_FLUENCE_TOKEN
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Set dependencies
@ -35,9 +57,6 @@ jobs:
with:
dependencies: ${{ inputs.cargo-dependencies }}
- name: Run cargo build
run: cargo build
- name: Run cargo check
run: cargo check -v --all-features
@ -49,3 +68,13 @@ jobs:
- name: Run rustfmt
uses: actions-rust-lang/rustfmt@v1
- name: Generate snapshot version
id: version
uses: fluencelabs/github-actions/generate-snapshot-id@main
- name: Publish crate snapshots
id: snapshot
uses: fluencelabs/github-actions/cargo-publish-snapshot@main
with:
id: ${{ steps.version.outputs.id }}