Skip to content

Commit

Permalink
Switch to using GitHub Actions as CI provider
Browse files Browse the repository at this point in the history
GitLab has repeatedly messed with webhooks, repository mirroring, and CI
itself in sinister ways that silently broke our CI from one day to the
next, without any advance notice, acknowledgment, or even hint what they
have done this time. On top of that, debugging their solution is a
nightmare and time sink, because they provide virtually no insight into
what is going on (at least not without involvement of third party
services) and their API endpoints may just indicate success and still do
nothing.
This time it appears that they decided to remove "pull" mirroring from
the free tier altogether, meaning that we can no longer keep code on
GitLab in sync with that on GitHub, assuming it is being pushed to the
latter. That renders their product entirely useless for our intents and
purposes.
To that end, this change switches over to using GitHub Actions as the CI
provider. While there are some direct advantages to this switch, such as
the much faster compilation and proper pull request integration, their
artifact upload is unusable for our intents and purposes. Uploaded
artifacts are seemingly always exposed as a zip archive and there is no
way to link to the most recent artifact. For us that means that code
coverage can no longer directly rely on generated HTML artifacts. As
such, we have to switch over to relying on codecov.io as the service to
which we upload collected data to be visualized.
Furthermore, we start off with a reasonably simple CI script that covers
all the steps we performed previously, but excludes all the advanced
caching logic. The reason for this decision is that GitHub Actions
workers are generally much faster and workflow duration is less of an
issue. Should this change in the future or the program become
significantly bigger, we can always revisit this decision.
  • Loading branch information
d-e-s-o committed Jul 25, 2022
1 parent 8f330c0 commit aa8ce4b
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 127 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright (C) 2022 Daniel Mueller <deso@posteo.net>
# SPDX-License-Identifier: GPL-3.0-or-later

name: CI

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# Build without debug information enabled to decrease compilation time
# and binary sizes in CI. This option is assumed to only have marginal
# effects on the generated code, likely only in terms of section
# arrangement. See
# https://doc.rust-lang.org/cargo/reference/environment-variables.html
# https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo
RUSTFLAGS: '-C debuginfo=0'

jobs:
build:
name: Build [${{ matrix.rust }}, ${{ matrix.profile }}]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: [1.57.0, stable]
profile: [dev, release]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- name: Build ${{ matrix.profile }}
run: |
cargo build --profile=${{ matrix.profile }} --lib --tests --all-features
test:
name: Test and coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions-rs/tarpaulin@v0.1
with:
version: latest
args: --exclude-files=src/api/v2/de.rs
out-type: Xml
env:
APCA_API_KEY_ID: ${{ secrets.APCA_API_KEY_ID }}
APCA_API_SECRET_KEY: ${{ secrets.APCA_API_SECRET_KEY }}
- name: Upload code coverage results
uses: codecov/codecov-action@v3
with:
files: cobertura.xml
clippy:
name: Lint with clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- run: cargo clippy --no-deps --all-targets --all-features --tests -- -A unknown_lints -D warnings
rustfmt:
name: Check code formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
override: true
- run: cargo +nightly fmt -- --check
cargo-doc:
name: Generate documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- run: cargo doc --no-deps
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Unreleased
----------
- Switched to using GitHub Actions as CI provider
- Bumped minimum supported Rust version to `1.57`


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![pipeline](https://gitlab.com/d-e-s-o/apca/badges/main/pipeline.svg)](https://gitlab.com/d-e-s-o/apca/commits/main)
[![coverage](https://gitlab.com/d-e-s-o/apca/badges/main/coverage.svg)](https://gitlab.com/d-e-s-o/apca/-/jobs/artifacts/main/file/tarpaulin-report/tarpaulin-report.html?job=test-coverage:tarpaulin)
[![pipeline](https://github.com/d-e-s-o/apca/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/d-e-s-o/apca/actions/workflows/ci.yml)
[![coverage](https://codecov.io/gh/d-e-s-o/apca/branch/main/graph/badge.svg)](https://codecov.io/gh/d-e-s-o/apca)
[![crates.io](https://img.shields.io/crates/v/apca.svg)](https://crates.io/crates/apca)
[![Docs](https://docs.rs/apca/badge.svg)](https://docs.rs/apca)
[![rustc](https://img.shields.io/badge/rustc-1.57+-blue.svg)](https://blog.rust-lang.org/2021/12/02/Rust-1.57.0.html)
Expand Down
124 changes: 0 additions & 124 deletions ci/gitlab-ci.yml

This file was deleted.

2 changes: 2 additions & 0 deletions examples/stream-realtime-data.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (C) 2022 The apca Developers
// SPDX-License-Identifier: GPL-3.0-or-later

#![allow(clippy::let_unit_value)]

use apca::data::v2::stream::drive;
use apca::data::v2::stream::MarketData;
use apca::data::v2::stream::RealtimeData;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#![type_length_limit = "536870912"]
#![allow(clippy::unreadable_literal)]
#![allow(clippy::let_unit_value, clippy::unreadable_literal)]
#![warn(
bad_style,
broken_intra_doc_links,
Expand Down

0 comments on commit aa8ce4b

Please sign in to comment.