diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..c8dbaa9 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,66 @@ +name: Rust + +on: [push] + +jobs: + style: + name: Style Checks (stable/ubuntu-latest) + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + - uses: hecrj/setup-rust-action@v1 + with: + components: "rustfmt,clippy" + - uses: actions/checkout@v1 + - name: Check code formatting + run: cargo fmt --all -- --check + - name: Check Clippy lints + run: cargo clippy --all-targets --all-features -- -D warnings + + compile: + name: Compile (${{ matrix.rust_release }}/${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + rust_release: [nightly, stable] + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@master + - uses: hecrj/setup-rust-action@v1 + with: + rust-version: ${{ matrix.rust_release }} + - name: Build + run: cargo build --verbose + + integration_test: + name: Integration Tests (stable/ubuntu-latest) + runs-on: ubuntu-latest + needs: [style, compile] + services: + influxdb: + image: influxdb + ports: + - 8086:8086 + authed_influxdb: + image: influxdb + ports: + - 9086:8086 + env: + INFLUXDB_HTTP_AUTH_ENABLED: true + INFLUXDB_ADMIN_USER: admin + INFLUXDB_ADMIN_PASSWORD: password + INFLUXDB_USER: nopriv_user + INFLUXDB_USER_PASSWORD: password + + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - uses: actions-rs/cargo@v1 + with: + command: test + args: --package influxdb --package influxdb_derive --all-features --no-fail-fast \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 525b308..0000000 --- a/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: rust - -sudo: required - -services: - - docker - -before_install: - - docker pull influxdb - - docker run -d -p 8086:8086 --name influxdb influxdb - - docker run -d -p 9086:8086 --name authed_influxdb -e INFLUXDB_HTTP_AUTH_ENABLED=true -e INFLUXDB_ADMIN_USER=admin -e INFLUXDB_ADMIN_PASSWORD=password -e INFLUXDB_USER=nopriv_user -e INFLUXDB_USER_PASSWORD=password influxdb - - docker ps - -branches: - only: - - master - -cache: - directories: - - /home/travis/.cargo - -before_cache: - - rm -rf /home/travis/.cargo/registry - -env: -os: - - linux -rust: - - stable - - beta - - nightly - - 1.39.0 - -matrix: - fast_finish: true - allow_failures: - include: - - rust: stable - env: NAME='linting' - before_script: - - rustup component add rustfmt - - rustup component add clippy - script: - - cargo fmt --all -- --check - - cargo clippy --all-targets --all-features -- -D warnings - - - rust: stable - env: NAME='readme-check' - before_script: - - bash auxiliary/update_cargo-readme.sh - script: - - bash auxiliary/check_readme_consistency.sh - -script: - - export RUST_BACKTRACE=1 - - cd influxdb - - cargo build - - cargo test --all --all-features - - cargo doc --no-deps - - cd ../influxdb_derive - - cargo build - - cargo test --all --all-features - - cargo doc --no-deps