Skip to content

Commit 90c9b56

Browse files
seznaadlerjohn
andauthored
Rename core_lang to core-lang, core-types to sway-types, and update dependencies to use crates.io (#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 <john.adler@protonmail.ch>
1 parent 7affe8a commit 90c9b56

File tree

142 files changed

+320
-263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+320
-263
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
core_lang/ @sezna
1+
sway-core/ @sezna
22
forc/ @sezna
3-
formatter/ @leviathanbeak
3+
sway-fmt/ @leviathanbeak
44
docs/ @adlerjohn @sezna
55
fuel-abi-cli/ @digorithm
66
fuels-abigen-macro/ @digorithm
77
fuels-rs/ @digorithm
88
lib-std/ @sezna
99
lib-core/ @sezna
1010
test/ @sezna
11-
core-types/ @leviathanbeak
11+
sway-types/ @sezna
1212
scripts/ @leviathanbeak

.github/workflows/cargo_test.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
release:
9+
types: [published]
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Cancel Previous Runs
20+
uses: styfle/cancel-workflow-action@0.9.1
21+
with:
22+
access_token: ${{ github.token }}
23+
24+
- name: Checkout repository
25+
uses: actions/checkout@v2
26+
27+
- name: Install toolchain
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
profile: minimal
31+
toolchain: stable
32+
override: true
33+
34+
- name: Install rustfmt
35+
run: rustup component add rustfmt
36+
37+
- name: Set git config
38+
run: |
39+
git config --global core.bigfilethreshold 500m
40+
41+
- name: Check formatting
42+
uses: actions-rs/cargo@v1
43+
with:
44+
command: fmt
45+
args: --all -- --check
46+
47+
- name: Install fuel-core
48+
uses: actions-rs/cargo@v1
49+
with:
50+
command: install
51+
# We use debug here to reduce build time, since the performance difference
52+
# is minimal between release and debug builds for the purposes of these tests.
53+
args: --debug fuel-core
54+
55+
- name: Run fuel-core
56+
run: |
57+
fuel-core &
58+
echo $! > ./fuel-core.pid
59+
60+
- name: Build
61+
uses: actions-rs/cargo@v1
62+
with:
63+
command: build
64+
env:
65+
RUSTFLAGS: "-D warnings"
66+
67+
- name: Run tests
68+
uses: actions-rs/cargo@v1
69+
with:
70+
command: run
71+
args: --release --bin test
72+
73+
- name: Kill fuel-core
74+
run: cat ./fuel-core.pid | xargs kill
75+
76+
77+
publish:
78+
# Only do this job if publishing a release
79+
needs: build
80+
if: github.event_name == 'release' && github.event.action == 'published'
81+
runs-on: ubuntu-latest
82+
83+
steps:
84+
- name: Checkout repository
85+
uses: actions/checkout@v2
86+
87+
- name: Install toolchain
88+
uses: actions-rs/toolchain@v1
89+
with:
90+
toolchain: stable
91+
override: true
92+
93+
- name: Verify tag version
94+
run: |
95+
cargo install toml-cli
96+
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} forc/Cargo.toml
97+
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-core/Cargo.toml
98+
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-fmt/Cargo.toml
99+
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-server/Cargo.toml
100+
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-types/Cargo.toml
101+
./.github/workflows/scripts/verify_tag.sh ${{ github.ref_name }} sway-utils/Cargo.toml
102+
- name: Publish crate
103+
uses: katyo/publish-crates@v1
104+
with:
105+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
err() {
5+
echo -e "\e[31m\e[1merror:\e[0m $@" 1>&2;
6+
}
7+
8+
status() {
9+
WIDTH=12
10+
printf "\e[32m\e[1m%${WIDTH}s\e[0m %s\n" "$1" "$2"
11+
}
12+
13+
REF=$1
14+
MANIFEST=$2
15+
16+
if [ -z "$REF" ]; then
17+
err "Expected ref to be set"
18+
exit 1
19+
fi
20+
21+
if [ -z "$MANIFEST" ]; then
22+
err "Expected manifest to be set"
23+
exit 1
24+
fi
25+
26+
# strip preceeding 'v' if it exists on tag
27+
REF=${REF/#v}
28+
TOML_VERSION=$(toml get $MANIFEST package.version | tr -d '"')
29+
30+
if [ "$TOML_VERSION" != "$REF" ]; then
31+
err "Crate version $TOML_VERSION, doesn't match tag version $REF"
32+
exit 1
33+
else
34+
status "Crate version matches tag $TOML_VERSION"
35+
fi

0 commit comments

Comments
 (0)