diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c3927a2..07181c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,19 +1,40 @@ name: Compile Rust Code on Release -on: [push] +on: + release: + types: [created] + jobs: - lint&test: + build: runs-on: ubuntu-latest - container: - image: node:alpine + steps: - - uses: actions/checkout@v4 - - run: apk add curl gcc rustup cargo rust - - run: cargo check - - run: cargo test - - run: cargo build --release + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Rust with Alpine + run: | + docker run --rm \ + -v ${{ github.workspace }}:/usr/src/myapp \ + -w /usr/src/myapp \ + rust:alpine \ + sh -c "apk add --no-cache musl-dev && cargo build --release" + + - name: Run Tests + run: | + docker run --rm \ + -v ${{ github.workspace }}:/usr/src/myapp \ + -w /usr/src/myapp \ + rust:alpine \ + sh -c "apk add --no-cache musl-dev && cargo test --release" + + - name: Package Artifacts + run: | + mkdir -p artifacts + cp target/release/your_executable artifacts/ + - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v2 with: - name: wololo-app - path: target/release/wololo + name: rust-release-artifacts + path: artifacts/