Skip to content

Commit

Permalink
feat: run test on contract changes (#123)
Browse files Browse the repository at this point in the history
* run only pull request with contract changes

* feat: pr condition

* fix: separate crate publish
  • Loading branch information
byeongsu-hong authored Mar 12, 2024
1 parent b2da0ae commit 25a3181
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 9 deletions.
29 changes: 24 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,31 @@ name: release
on:
push:
tags:
- "v*.*.*"
- 'v*.*.*'

jobs:
crate:
name: crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
run: |
rustup toolchain install 1.72 \
--profile minimal \
--target wasm32-unknown-unknown \
--no-self-update
- name: Cache dependencies
uses: Swatinem/rust-cache@v2

- name: Install Deps
run: make install-prod

- name: Publish hpl-interface
run: cargo publish --token ${{ secrets.CRATES_TOKEN }} --package hpl-interface

artifact:
permissions:
contents: write
Expand Down Expand Up @@ -42,10 +64,7 @@ jobs:
env:
ARTIFACT_NAME: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip

- name: Publish hpl-interface
run: cargo publish --token ${{ secrets.CRATES_TOKEN }} --package hpl-interface

- name: Release
- name: Release Artifact
uses: softprops/action-gh-release@v1
with:
files: |
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ name: test

on:
pull_request:
paths:
- 'contracts/**'
- 'packages/**'
- 'Cargo.toml'
push:
branches:
- "main"
- 'main'

jobs:
unit-test:
strategy:
fail-fast: true

name: unit-test
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -39,11 +43,11 @@ jobs:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Install Rust
run: |
rustup toolchain install 1.72 \
Expand Down

0 comments on commit 25a3181

Please sign in to comment.