Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename core_lang to core-lang, core-types to sway-types, and update dependencies to use crates.io #486

Merged
merged 27 commits into from
Dec 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
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/cancel-workflow-action@0.9.1
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