Skip to content

Commit

Permalink
Merge pull request #4 from FuelLabs/k1-r1/ci-setup
Browse files Browse the repository at this point in the history
feat: Add initial CI
  • Loading branch information
K1-R1 authored Jul 12, 2024
2 parents 706a1fa + e29caca commit 7bff820
Show file tree
Hide file tree
Showing 7 changed files with 275 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @FuelLabs/swayex
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/brand_new_feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Requesting New Feature
description: If you are adding something completely new then use this template!
title: "<title>"
labels: ["New Feature"]
body:
- type: textarea
id: motivation
attributes:
label: Motivation
description: Describe your feature, motivation behind it and write a mini-specification
placeholder: |
#### Description
This feature ...
#### Motivation
It allows ...
#### Specification
...
validations:
required: true
60 changes: 60 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Bug Report
description: File a bug report
title: "<title>"
labels: ["bug"]
body:
- type: textarea
id: description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: Tell us how to reproduce the bug
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
id: codeblock
attributes:
label: Minimal reproducible code example
description: Copy and paste your Sway / Rust code here, it will automatically be formatted so no need for backticks.
render: Rust
validations:
required: true
- type: input
id: rustc-version
attributes:
label: Rust Version
description: Run the command `rustc --version`
placeholder: ex. rustc 1.61.0 (fe5b13d68 2022-05-18)
validations:
required: true
- type: input
id: forc-version
attributes:
label: Forc Version
description: Run the command `forc --version`
placeholder: ex. forc 0.14.2
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behavior
description: A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
id: misc
attributes:
label: Additional context
description: Add any other context / screenshots about the problem go here
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/improvement_to_existing_feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Improvement to Feature
description: If you are improving something that already exists then use this template!
title: "<title>"
labels: ["Improvement"]
body:
- type: textarea
id: motivation
attributes:
label: Motivation
description: Describe the improvement, motivation behind it and write a mini-specification
placeholder: |
#### Description
This improves the feature by ...
#### Motivation
It allows ...
#### Specification
...
validations:
required: true
37 changes: 37 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Type of change

<!--Delete points that do not apply-->

- Bug fix
- New feature
- Improvement (refactoring, restructuring repository, cleaning tech debt, ...)
- Documentation
- Other (describe below)

## Changes

The following changes have been made:

- Change 1
- Change 2

## Notes

- Note 1

## Related Issues

<!--Delete everything after the "#" symbol and replace it with a number. No spaces between hash and number-->

Closes #\<issue number\>

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand areas.
- [ ] I have updated the documentation where relevant.
- [ ] I have added tests that prove my fix is effective or that my feature works.
- [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
- [ ] I have updated the changelog to reflect the changes on this PR.
106 changes: 106 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: CI

on:
push:
branches:
- master
pull_request:
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
REGISTRY: ghcr.io
RUST_VERSION: 1.79.0

jobs:
build-projects:
runs-on: ubuntu-latest
strategy:
matrix:
project:
[
"src14/owned_proxy",
]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Init cache
uses: Swatinem/rust-cache@v2

- name: Install Fuel toolchain
uses: FuelLabs/[email protected]
with:
toolchain: latest

- name: Check Sway formatting
run: |
cd ${{ matrix.project }}
forc fmt --check
- name: Build Sway
run: |
cd ${{ matrix.project }}
forc build --release --locked
test-projects:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Init cache
uses: Swatinem/rust-cache@v2

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy, rustfmt

- name: Install Fuel toolchain
uses: FuelLabs/[email protected]
with:
toolchain: latest

- name: Build All Tests Artifacts
run: forc build --path tests --release

- name: Check Rust formatting
run: cargo fmt --manifest-path tests/Cargo.toml --verbose --check

- name: Check Clippy Linter
run: cargo clippy --manifest-path tests/Cargo.toml --all-features --all-targets -- -D warnings

- name: Cargo Test sway-lib
run: cargo test --manifest-path tests/Cargo.toml

lint-toml-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}

- name: Install Cargo.toml linter
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-toml-lint
version: "0.1.1"

- name: Run Cargo.toml linter
run: git ls-files | grep Cargo.toml$ | xargs --verbose -n 1 cargo-toml-lint

check-changelog:
name: Check Changelog
runs-on: ubuntu-latest
steps:
- uses: tarides/changelog-check-action@v2
with:
changelog: CHANGELOG.md
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased] - yyyy-mm-dd

Description of the upcoming release here.

### Added

- [#4](https://github.com/FuelLabs/sway-standard-implementations/pull/4) Adds initial CI.

### Changed

- Something changed here 1
- Something changed here 2

### Fixed

- Something fixed here 1
- Something fixed here 2

#### Breaking

- Some breaking change here 1
- Some breaking change here 2

0 comments on commit 7bff820

Please sign in to comment.