Skip to content

Commit

Permalink
Rename core_lang to core-lang, core-types to sway-types, and update d…
Browse files Browse the repository at this point in the history
…ependencies to use crates.io (FuelLabs#486)

* Rename core_lang to core-lang

* update workspace to sway-types

* Rename

* update readme

* add verifys cript

* update ci

* update some names

* fix

* rename formatter to sway-fmt

* rename core-lang to sway-core

* specify version for sway fmt

* Prevent publishing.

* add sway server to check

* alpha

* Update manifest files.

* Remove duplicate core types.

* update test harness; use crates.io for fuel-client

* formatting

* forgotten add

* update fuel-core test

* run fuel-core in the background

* update README

* kill fuel-core after use

* yaml tweak

Co-authored-by: John Adler <[email protected]>
  • Loading branch information
sezna and adlerjohn authored Dec 25, 2021
1 parent 7affe8a commit 90c9b56
Show file tree
Hide file tree
Showing 142 changed files with 320 additions and 263 deletions.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
core_lang/ @sezna
sway-core/ @sezna
forc/ @sezna
formatter/ @leviathanbeak
sway-fmt/ @leviathanbeak
docs/ @adlerjohn @sezna
fuel-abi-cli/ @digorithm
fuels-abigen-macro/ @digorithm
fuels-rs/ @digorithm
lib-std/ @sezna
lib-core/ @sezna
test/ @sezna
core-types/ @leviathanbeak
sway-types/ @sezna
scripts/ @leviathanbeak
83 changes: 0 additions & 83 deletions .github/workflows/cargo_test.yml

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: CI

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

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Install rustfmt
run: rustup component add rustfmt

- name: Set git config
run: |
git config --global core.bigfilethreshold 500m
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Install fuel-core
uses: actions-rs/cargo@v1
with:
command: install
# We use debug here to reduce build time, since the performance difference
# is minimal between release and debug builds for the purposes of these tests.
args: --debug fuel-core

- name: Run fuel-core
run: |
fuel-core &
echo $! > ./fuel-core.pid
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
env:
RUSTFLAGS: "-D warnings"

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: run
args: --release --bin test

- name: Kill fuel-core
run: cat ./fuel-core.pid | xargs kill


publish:
# Only do this job if publishing a release
needs: build
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Verify tag version
run: |
cargo install toml-cli
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} forc/Cargo.toml
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-core/Cargo.toml
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-fmt/Cargo.toml
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-server/Cargo.toml
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-types/Cargo.toml
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-utils/Cargo.toml
- name: Publish crate
uses: katyo/publish-crates@v1
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/scripts/verify_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
set -e

err() {
echo -e "\e[31m\e[1merror:\e[0m $@" 1>&2;
}

status() {
WIDTH=12
printf "\e[32m\e[1m%${WIDTH}s\e[0m %s\n" "$1" "$2"
}

REF=$1
MANIFEST=$2

if [ -z "$REF" ]; then
err "Expected ref to be set"
exit 1
fi

if [ -z "$MANIFEST" ]; then
err "Expected manifest to be set"
exit 1
fi

# strip preceeding 'v' if it exists on tag
REF=${REF/#v}
TOML_VERSION=$(toml get $MANIFEST package.version | tr -d '"')

if [ "$TOML_VERSION" != "$REF" ]; then
err "Crate version $TOML_VERSION, doesn't match tag version $REF"
exit 1
else
status "Crate version matches tag $TOML_VERSION"
fi
Loading

0 comments on commit 90c9b56

Please sign in to comment.