From 4ff8e9564093f4c6293dc6436934294f26c9270e Mon Sep 17 00:00:00 2001 From: projectmoon Date: Mon, 31 Aug 2020 20:48:46 +0000 Subject: [PATCH] One CI pipeline for build, test, docker push. --- .../{docker-publish.yml => dicebot-ci.yml} | 21 +++++++++++++----- .github/workflows/rust.yml | 22 ------------------- 2 files changed, 15 insertions(+), 28 deletions(-) rename .github/workflows/{docker-publish.yml => dicebot-ci.yml} (84%) delete mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/dicebot-ci.yml similarity index 84% rename from .github/workflows/docker-publish.yml rename to .github/workflows/dicebot-ci.yml index 5b123f8..0f1f958 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/dicebot-ci.yml @@ -1,4 +1,4 @@ -name: Docker +name: Dicebot CI on: push: @@ -14,13 +14,22 @@ on: pull_request: env: - # TODO: Change variable to your image's name. - IMAGE_NAME: image + IMAGE_NAME: chronicle-dicebot + CARGO_TERM_COLOR: always jobs: # Run tests. # 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 steps: @@ -37,9 +46,9 @@ jobs: # Push image to GitHub Packages. # See also https://docs.docker.com/docker-hub/builds/ - push: + docker_push: # Ensure test job passes before pushing image. - needs: test + needs: [ build_and_test, docker_test ] runs-on: ubuntu-latest if: github.event_name == 'push' diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 3c13d1b..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -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