Add test.yml
This commit is contained in:
parent
4cc2648650
commit
e0e4c0650d
1 changed files with 40 additions and 0 deletions
40
test.yml
Normal file
40
test.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
name: Compile Rust Code on Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- 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@v2
|
||||||
|
with:
|
||||||
|
name: rust-release-artifacts
|
||||||
|
path: artifacts/
|
||||||
Loading…
Add table
Add a link
Reference in a new issue