diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..34ec03c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: Yellow + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: magnonellie/amethyst-dependencies:latest + steps: + - name: Install dependencies + run: apt install gcc pkg-config openssl libasound2-dev cmake build-essential python3 libfreetype6-dev libexpat1-dev libxcb-composite0-dev libssl-dev libx11-dev + - name: Check Formatting + run: cargo fmt -- --check + - name: Build + run: cargo build --verbose --all + - name: Run tests + run: cargo test --verbose --all + - name: Discord notification + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + uses: Ilshidur/action-discord@master diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bb6d1b9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: rust -rust: - - stable - - beta - - nightly -jobs: - allow_failures: - - rust: nightly - fast_finish: true -cache: cargo - -before_install: - - sudo apt-get -qq update - - sudo apt-get install -y gcc pkg-config openssl libasound2-dev cmake build-essential python3 libfreetype6-dev libexpat1-dev libxcb-composite0-dev libssl-dev libx11-dev - -script: - - cargo build --verbose --all - - cargo test --verbose --all -after_success: - - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh - - chmod +x send.sh - - ./send.sh success $WEBHOOK_URL -after_failure: - - wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh - - chmod +x send.sh - - ./send.sh failure $WEBHOOK_URL \ No newline at end of file diff --git a/Makefile b/Makefile index 3809645..565363f 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ DOCKER_IMAGE = yellow:latest run: - docker run --rm -it ${DOCKER_IMAGE} cargo run + docker run --rm ${DOCKER_IMAGE} cargo run build: - docker run --rm -it ${DOCKER_IMAGE} cargo build + docker run --rm ${DOCKER_IMAGE} cargo build test: - docker run --rm -it ${DOCKER_IMAGE} cargo test + docker run --rm ${DOCKER_IMAGE} cargo test setup: docker build -t yellow . diff --git a/README.md b/README.md index ce79fcf..05dcfe6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Yellow - A simple Rust game -[![Build Status](https://travis-ci.com/Druue/yellow.svg?branch=master)](https://travis-ci.com/Druue/yellow) +![Yellow](https://github.com/Druue/yellow/workflows/Yellow/badge.svg) More information will come....