diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..8f5e101 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @FuelLabs/swayex diff --git a/.github/ISSUE_TEMPLATE/brand_new_feature.yml b/.github/ISSUE_TEMPLATE/brand_new_feature.yml new file mode 100644 index 0000000..3731d58 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/brand_new_feature.yml @@ -0,0 +1,21 @@ +name: Requesting New Feature +description: If you are adding something completely new then use this template! +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 diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..53c0c3d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -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 diff --git a/.github/ISSUE_TEMPLATE/improvement_to_existing_feature.yml b/.github/ISSUE_TEMPLATE/improvement_to_existing_feature.yml new file mode 100644 index 0000000..fc87655 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/improvement_to_existing_feature.yml @@ -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 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..b260444 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5580511 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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/action-fuel-toolchain@v0.6.0 + 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/action-fuel-toolchain@v0.6.0 + 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 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0db8497 --- /dev/null +++ b/CHANGELOG.md @@ -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