From 37aa6b2017f9fdb806356f0661e25a0f1fef38be Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Sun, 12 Mar 2023 19:41:25 +0100 Subject: [PATCH] Add CI --- .github/workflows/ruby.yml | 36 --------------------------- .github/workflows/test.yml | 51 ++++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/ruby.yml diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml deleted file mode 100644 index c9532a1..0000000 --- a/.github/workflows/ruby.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Ruby - -on: - push: - branches: - - main - - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - name: Ruby ${{ matrix.ruby }} - strategy: - matrix: - ruby: - - '3.2.0' - - steps: - - uses: actions/checkout@v3 - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: "1.20" - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - working-directory: ruby - - name: Run build & test - run: | - cd ruby - bundle exec rake build test \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6171642..b537a26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,18 +1,49 @@ -name: tests +name: Tests -on: [push] +on: + push: + branches: + - rust + pull_request: + +env: + RUSTFLAGS: -Dwarnings + CARGO_NET_RETRY: 10 + CI: 1 + RUST_BACKTRACE: short + RUSTUP_MAX_RETRIES: 10 jobs: - build: + build_and_test: + name: Build and test + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + steps: + - uses: actions/checkout@master + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + + - name: check + run: cargo check --all + + - name: tests + run: cargo test --all + + check_fmt_and_docs: + name: Checking fmt and docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@master + - uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + - uses: Swatinem/rust-cache@v2 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: "1.20" + - name: fmt + run: cargo fmt --all -- --check - - name: Test - run: go test -v ./... + - name: Docs + run: cargo doc --no-deps