Skip to content

Commit

Permalink
add build and publish to CI (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej authored Sep 2, 2024
2 parents ab22c1c + 5bbcf21 commit 4c30fb9
Show file tree
Hide file tree
Showing 19 changed files with 2,207 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
name: CI

env:
CI_RUST_TOOLCHAIN: 1.66
CI_RUST_TOOLCHAIN: 1.73.0

jobs:
check:
Expand Down
87 changes: 87 additions & 0 deletions .github/workflows/wasix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
cancel-in-progress: true

jobs:
build-wasix:
runs-on: ubuntu-22.04
name: "Build WASIX"
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install Tools
run: |
sudo apt-get update
sudo apt-get install -y git llvm clang make lld curl rclone
- name: "Install cargo-wasix"
run: |
cargo install cargo-wasix
- name: "Download Toolchain"
run: |
cargo wasix download-toolchain v2024-06-26.1
- name: "Build"
run: |
cargo wasix build --features=binary --release --bin s3-server
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: s3-server
path: target/wasm32-wasmer-wasi/release/s3-server.wasm

test-wasix:
runs-on: ubuntu-22.04
needs: build-wasix
name: "Test WASIX"
steps:
- uses: actions/checkout@v4
- name: Setup Wasmer
uses: wasmerio/setup-wasmer@v3.1
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: s3-server
- name: List contents
run: |
ls
- name: Install Tools
run: |
sudo apt-get update
sudo apt-get install -y git llvm clang make lld curl rclone
- name: "Create rclone config"
run: |
mkdir -p ~/.config/rclone
printf "[data]\ntype = s3\nprovider = Other\nacl = private\naccess_key_id = access-key-id\nsecret_access_key = secret-access-key\nendpoint = http://localhost:8080" > ~/.config/rclone/rclone.conf
cat ~/.config/rclone/rclone.conf
RUN_RCLONE=1 ./scripts/wasix-test.sh
publish:
runs-on: ubuntu-22.04
if: ${{ github.ref == 'refs/heads/master' }}
needs: [build-wasix, test-wasix]
name: "Publish"
steps:
- uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: s3-server
- name: Setup Wasmer
uses: wasmerio/setup-wasmer@v3.1
- name: List contents
run: |
ls
- name: "Push"
run: |
wasmer package push --registry="wasmer.io" --non-interactive --token=${{ secrets.WASMER_CIUSER_PROD_TOKEN }} .
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/target
Cargo.lock

.vscode
/.idea
Expand Down
Loading

0 comments on commit 4c30fb9

Please sign in to comment.