Skip to content

Commit

Permalink
Rewrite CI and replace archived dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
oxalica committed Feb 19, 2024
1 parent 6b0faeb commit 6f5b29a
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 124 deletions.
116 changes: 0 additions & 116 deletions .github/workflows/basic_test.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI
on:
pull_request:
push:

permissions:
contents: read

env:
RUST_BACKTRACE: full

jobs:
sanity:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: cargo fmt
run: cargo fmt --all -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: cargo clippy
run: cargo clippy --all-targets -- -Dwarnings
- name: cargo doc
run: cargo doc --all ${{ matrix.feature_flag }}
env:
RUSTDOCFLAGS: -Dwarnings

test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable, beta]
feature_flag: ['']
include:
- os: ubuntu-latest
feature_flag: --features=beta
name: Test ${{ matrix.os }} ${{ matrix.rust }} ${{ matrix.feature_flag }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain
with:
toolchain: ${{ matrix.rust }}
- name: Build
run: cargo build ${{ matrix.feature_flag }}
- name: Test
run: cargo test ${{ matrix.feature_flag }}
20 changes: 12 additions & 8 deletions .github/workflows/real_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
- master
- ci-test

workflow_dispatch:

permissions:
contents: read

env:
RUST_BACKTRACE: full

Expand All @@ -13,20 +18,19 @@ jobs:
name: Real test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Build onedrive-api-test
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Build
run: |
cd onedrive-api-test
cargo test --no-run
- name: Run real Test
- name: Test
env:
ONEDRIVE_API_TEST_CLIENT_ID: ${{ secrets.ONEDRIVE_API_TEST_CLIENT_ID }}
ONEDRIVE_API_TEST_REDIRECT_URI: ${{ secrets.ONEDRIVE_API_TEST_REDIRECT_URI }}
ONEDRIVE_API_TEST_REFRESH_TOKEN: ${{ secrets.ONEDRIVE_API_TEST_REFRESH_TOKEN }}
run: |
cd onedrive-api-test
cargo test -- -Z unstable-options --include-ignored
cargo test --include-ignored

0 comments on commit 6f5b29a

Please sign in to comment.