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. 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 21, 2022
1 parent a8f5450 commit c332ac5
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 90 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,60 @@
# 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:
test:
name: Build and test [${{ 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 & test ${{ matrix.profile }}
run: |
cargo build --profile=${{ matrix.profile }} --bins
cargo test --profile=${{ matrix.profile }}
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 -A deprecated -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
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,7 @@ Unreleased
- Added support for submission of more kinds of bracket orders
- Migrated over to using `clap` v3 for argument parsing
- Removed `structopt` dependency
- Switched to using GitHub Actions as CI provider
- Bumped minimum supported Rust version to `1.57`
- Bumped `apca` dependency to `0.25.0`

Expand Down
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
[![pipeline](https://gitlab.com/d-e-s-o/apcacli/badges/main/pipeline.svg)](https://gitlab.com/d-e-s-o/apcacli/commits/main)
[![pipeline](https://github.com/d-e-s-o/apcacli/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/d-e-s-o/apcacli/actions/workflows/ci.yml)
[![crates.io](https://img.shields.io/crates/v/apcacli.svg)](https://crates.io/crates/apcacli)
[![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
87 changes: 0 additions & 87 deletions ci/gitlab-ci.yml

This file was deleted.

8 changes: 6 additions & 2 deletions src/main.rs
Expand Up @@ -2,7 +2,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#![type_length_limit = "536870912"]
#![allow(clippy::large_enum_variant, clippy::let_and_return)]
#![allow(
clippy::large_enum_variant,
clippy::let_and_return,
clippy::let_unit_value
)]

mod args;

Expand Down Expand Up @@ -244,7 +248,7 @@ fn format_activity_type(side: account_activities::ActivityType) -> &'static str

/// Sort a vector of `Activity` objects in descending order of their
/// time stamps.
fn sort_account_activity(activities: &mut Vec<account_activities::Activity>) {
fn sort_account_activity(activities: &mut [account_activities::Activity]) {
activities.sort_by(|act1, act2| {
let ordering = match act1 {
account_activities::Activity::Trade(trade1) => match act2 {
Expand Down

0 comments on commit c332ac5

Please sign in to comment.