Skip to content

Commit

Permalink
chore: remove and ignore generated src/bindings.rs files (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
sehnryr authored Jul 5, 2024
1 parent 171cb49 commit 5b340f8
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 2,115 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

52 changes: 41 additions & 11 deletions .github/workflows/test-and-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

env:
CARGO_COMPONENT_VERSION: "0.11.0"
SCCACHE_CACHE_SIZE: "2G"
SCCACHE_VERSION: "0.8.0"
RUSTC_WRAPPER: "/usr/local/bin/sccache"

jobs:
test:
name: Test modified extensions
env:
CARGO_COMPONENT_VERSION: "0.11.0"
SCCACHE_CACHE_SIZE: "2G"
SCCACHE_VERSION: "0.8.0"
RUSTC_WRAPPER: "/usr/local/bin/sccache"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -110,16 +111,45 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Restore cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
~/.cargo/bin
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install cargo-component
run: |
if ! command -v cargo-component || ! cargo-component --version | grep -q $CARGO_COMPONENT_VERSION; then
if [ "${{ runner.os }}" = "Linux" ]; then
cargo_component_platform="x86_64-unknown-linux-gnu"
elif [ "${{ runner.os }}" = "macOS" ]; then
cargo_component_platform="x86_64-apple-darwin"
elif [ "${{ runner.os }}" = "Windows" ]; then
cargo_component_platform="x86_64-pc-windows-gnu"
else
echo "Unsupported platform: ${{ runner.os }}"
exit 1
fi
cargo_component_file="cargo-component-${cargo_component_platform}"
cargo_component_url="https://github.com/bytecodealliance/cargo-component/releases/download/v${CARGO_COMPONENT_VERSION}/${cargo_component_file}"
echo "URL=${cargo_component_url}"
curl -L "$cargo_component_url" -o ~/.cargo/bin/cargo-component
chmod +x ~/.cargo/bin/cargo-component
fi
- name: Run `cargo fmt`
run: cargo fmt --all -- --check
run: cargo component fmt --all -- --check

build:
name: Build extensions
needs: rustfmt
env:
CARGO_COMPONENT_VERSION: "0.11.0"
SCCACHE_CACHE_SIZE: "2G"
SCCACHE_VERSION: "0.8.0"
RUSTC_WRAPPER: "/usr/local/bin/sccache"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
46 changes: 40 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ on:
pull_request:
branches: ["main"]

env:
CARGO_COMPONENT_VERSION: "0.11.0"
SCCACHE_CACHE_SIZE: "2G"
SCCACHE_VERSION: "0.8.0"
RUSTC_WRAPPER: "/usr/local/bin/sccache"

jobs:
test:
name: Test modified extensions
env:
CARGO_COMPONENT_VERSION: "0.11.0"
SCCACHE_CACHE_SIZE: "2G"
SCCACHE_VERSION: "0.8.0"
RUSTC_WRAPPER: "/usr/local/bin/sccache"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -108,5 +109,38 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Restore cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
~/.cargo/bin
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install cargo-component
run: |
if ! command -v cargo-component || ! cargo-component --version | grep -q $CARGO_COMPONENT_VERSION; then
if [ "${{ runner.os }}" = "Linux" ]; then
cargo_component_platform="x86_64-unknown-linux-gnu"
elif [ "${{ runner.os }}" = "macOS" ]; then
cargo_component_platform="x86_64-apple-darwin"
elif [ "${{ runner.os }}" = "Windows" ]; then
cargo_component_platform="x86_64-pc-windows-gnu"
else
echo "Unsupported platform: ${{ runner.os }}"
exit 1
fi
cargo_component_file="cargo-component-${cargo_component_platform}"
cargo_component_url="https://github.com/bytecodealliance/cargo-component/releases/download/v${CARGO_COMPONENT_VERSION}/${cargo_component_file}"
echo "URL=${cargo_component_url}"
curl -L "$cargo_component_url" -o ~/.cargo/bin/cargo-component
chmod +x ~/.cargo/bin/cargo-component
fi
- name: Run `cargo fmt`
run: cargo fmt --all -- --check
run: cargo component fmt --all -- --check
19 changes: 18 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/target
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

# RustRover
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# Ignore all src/bindings.rs files generated by wit-bindgen
**/src/bindings.rs
Loading

0 comments on commit 5b340f8

Please sign in to comment.