One CI pipeline for build, test, docker push.

This commit is contained in:
projectmoon 2020-08-31 20:48:46 +00:00
parent 0d16d9f2cd
commit 4ff8e95640
2 changed files with 15 additions and 28 deletions

View File

@ -1,4 +1,4 @@
name: Docker name: Dicebot CI
on: on:
push: push:
@ -14,13 +14,22 @@ on:
pull_request: pull_request:
env: env:
# TODO: Change variable to your image's name. IMAGE_NAME: chronicle-dicebot
IMAGE_NAME: image CARGO_TERM_COLOR: always
jobs: jobs:
# Run tests. # Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/ # See also https://docs.docker.com/docker-hub/builds/automated-testing/
test: build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
docker_test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -37,9 +46,9 @@ jobs:
# Push image to GitHub Packages. # Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/ # See also https://docs.docker.com/docker-hub/builds/
push: docker_push:
# Ensure test job passes before pushing image. # Ensure test job passes before pushing image.
needs: test needs: [ build_and_test, docker_test ]
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' if: github.event_name == 'push'

View File

@ -1,22 +0,0 @@
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose