This commit is contained in:
parent
85d3b85823
commit
4f20a7632a
|
@ -1,27 +1,32 @@
|
||||||
name: Run Cargo Tests
|
name: Rust Library Test
|
||||||
|
|
||||||
on:
|
on: [push, pull_request]
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
run: |
|
||||||
|
docker run --rm \
|
||||||
|
-v ${PWD}:/workspace \
|
||||||
|
-w /workspace \
|
||||||
|
alpine/git clone $CI_REPOSITORY_URL .
|
||||||
|
|
||||||
- name: Set up Docker container
|
- name: Set up Rust
|
||||||
uses: addnab/docker-run-action@v3
|
run: |
|
||||||
with:
|
docker run --rm \
|
||||||
image: rust:latest
|
-v ${PWD}:/workspace \
|
||||||
options: -v ${{ github.workspace }}:/workspace
|
-w /workspace \
|
||||||
run: |
|
rust:latest \
|
||||||
cd /workspace
|
sh -c "rustup update"
|
||||||
cargo test --lib
|
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
docker run --rm \
|
||||||
|
-v ${PWD}:/workspace \
|
||||||
|
-w /workspace \
|
||||||
|
rust:latest \
|
||||||
|
sh -c "cargo test --lib"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue