From f8d17979cf8c4fa4324ac04813ad3bbcec1df257 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 4 Feb 2021 16:52:19 +0100 Subject: [PATCH] Moved to Github Actions --- .github/workflows/ci.yml | 30 +++++++++++ .github/workflows/clippy.yml | 21 ++++++++ .github/workflows/rustfmt.yml | 23 ++++++++ .travis.yml | 98 ----------------------------------- ci/script.sh | 22 +++----- 5 files changed, 81 insertions(+), 113 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/clippy.yml create mode 100644 .github/workflows/rustfmt.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..224003af --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +on: + push: + branches: [ master ] + pull_request: + +name: Continuous integration + +jobs: + ci: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-16.04, ubuntu-18.04, ubuntu-latest, macos-latest] + env: + DO_DOCKER: 0 + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + - uses: actions/setup-python@v2 + with: + python-version: '3.x' + architecture: 'x64' + - run: bash ./ci/script.sh diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml new file mode 100644 index 00000000..aa1efe3d --- /dev/null +++ b/.github/workflows/clippy.yml @@ -0,0 +1,21 @@ +on: + push: + branches: [ master ] + pull_request: + +name: Clippy check +jobs: + clippy_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --examples diff --git a/.github/workflows/rustfmt.yml b/.github/workflows/rustfmt.yml new file mode 100644 index 00000000..102f0e3d --- /dev/null +++ b/.github/workflows/rustfmt.yml @@ -0,0 +1,23 @@ +on: + push: + branches: [ master ] + pull_request: + +name: Code formatting check + +jobs: + fmt: + name: Rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + - uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5bf44bee..00000000 --- a/.travis.yml +++ /dev/null @@ -1,98 +0,0 @@ -language: rust - -matrix: - include: - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # [Job 1] Xenial + Stable Rust + Python 3.6 - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - os: linux - dist: xenial - addons: - apt: - sources: - - deadsnakes - packages: - - gcc - - python3.6 - - python3.6-dev - env: - - TARGET=x86_64-unknown-linux-gnu - - PYTHON_VERSION=3.6 - - DO_DOCKER=0 - rust: stable - python: "3.6" - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # [Job 2] Xenial, Test Docker - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - os: linux - dist: xenial - services: - - docker - env: - - DO_DOCKER=1 - - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # [Job 3] Trusty + Stable Rust + Python 3.6 - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - os: linux - dist: trusty - addons: - apt: - sources: - - deadsnakes - packages: - - gcc - - python3.6 - - python3.6-dev - env: - - TARGET=x86_64-unknown-linux-gnu - - PYTHON_VERSION=3.6 - - DO_DOCKER=0 - rust: stable - python: "3.6" - - - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - # [Job 4] OSX + Stable Rust + Python 3.6 - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - os: osx - env: - - TARGET=i686-apple-darwin - - PYTHON_VERSION=3.7.5 - - DO_DOCKER=0 - rust: stable - python: "3.7.5" - - - -before_install: - - set -e - - python3 --version - -install: - - bash ci/install.sh - -before_script: - - rustup component add clippy - -script: - - bash ci/script.sh - -after_script: set +e - -cache: cargo - -before_cache: - - chmod -R a+r $HOME/.cargo; - -notifications: - webhooks: - urls: - - https://webhooks.gitter.im/e/196d37e7f965d6bd599d - on_success: always # options: [always|never|change] default: always - on_failure: always - on_start: always - diff --git a/ci/script.sh b/ci/script.sh index 546e43a8..63b3538f 100755 --- a/ci/script.sh +++ b/ci/script.sh @@ -2,31 +2,23 @@ set -euxo pipefail regular_test() { - # Run Rust tests - # ------------------------------------ - cargo test - - # Run Clippy - # ------------------------------------ - cargo clippy --all-targets --all-features - # Run Python tests # ------------------------------------ # Create virtual environment cd open-codegen export PYTHONPATH=. - virtualenv -p python$PYTHON_VERSION venv - - # --- activate venv - source venv/bin/activate - + # virtualenv -p python3 venv + + # # --- activate venv + # source venv/bin/activate + # --- install opengen python setup.py install - + # --- uncomment to run main file # run opengen main.py - + # --- run the tests cd opengen export PYTHONPATH=.