Skip to content

Commit

Permalink
feat: add .github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
PFC-developer committed Apr 24, 2024
1 parent e659683 commit 3cec058
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## 👀 What is Changed?

*

## 📣 API Changes

*

## 📝 Notes

*

## ☑️ Checklist
- [ ] The code compiles successfully
- [ ] I've run `cargo clippy` to lint and check code style
- [ ] I've written the test code and runs successfully
- [ ] I've updated API docs and noticed to the co-workers for updates
37 changes: 37 additions & 0 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release Artifacts

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5

jobs:
release-artifacts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Generate Cargo.lock
run: |
cargo build --workspace
cargo fetch --verbose
- name: Build Artifacts
run: |
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/workspace-optimizer:0.15.1
tar -zcvf cosmwasm-artifacts.tar.gz artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: cosmwasm-artifacts.tar.gz
body_path: CHANGELOG.md
61 changes: 61 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Formatting Check & Test

on:
pull_request:
push:
branches:
- main
- develop
- "release/*"

jobs:
clippy:
name: Actions - clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
profile: minimal
override: true
- run: cargo fetch --verbose
- run: cargo clippy --all --all-targets -- -D warnings

rustfmt:
name: Actions - rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
profile: minimal
override: true
- run: cargo +nightly fmt -- --check

unit-test:
name: Actions - unit test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- run: cargo fetch --verbose
- run: cargo build
- run: cargo test --verbose --all
env:
RUST_BACKTRACE: 1

0 comments on commit 3cec058

Please sign in to comment.