Skip to content

Commit

Permalink
[PLATFORM-1363]: Migrate to GHA (#24)
Browse files Browse the repository at this point in the history
* Add CI step with GHA

* Fix clippy warning on phantomdata default call

* Remove unused steps from ci

* Add cd

* Remove drone.yml

* Change alls-green impl

* Remove comment

* Change from ubuntu to self-hosted runner

* Switch to k8s-small

* Revert to ubuntu-latest
  • Loading branch information
cottinisimone authored Nov 28, 2023
1 parent 53bbf3c commit fb31f40
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 271 deletions.
269 changes: 0 additions & 269 deletions .drone.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CD

on:
release:
types: [published]

env:
CARGO_TERM_COLOR: always

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install cargo-release
uses: taiki-e/install-action@v2
with:
tool: [email protected]
- name: login
run: cargo login "$CARGO_AUTH_KEY"
env:
CARGO_AUTH_KEY: ${{ secrets.CARGO_AUTH_KEY }}
- name: publish
run: cargo release publish --no-confirm --allow-branch "*" --all-features --execute
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
lint:
# Avoid duplicate jobs on PR from a branch on the same repo
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --all-features
- name: cargo fmt
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --all-features -- -D warnings
- name: Build docs
run: cargo doc --document-private-items --all-features --no-deps
env:
RUSTDOCFLAGS: -Dwarnings
test:
# Avoid duplicate jobs on PR from a branch on the same repo
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test

alls-green:
if: always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
runs-on: ubuntu-latest
needs:
- lint
- test
steps:
- run: ${{ !contains(needs.*.result, 'failure') }}
4 changes: 2 additions & 2 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ impl<T: JwksSource + Send + Sync + 'static> JwksClientBuilder<T> {
pub(crate) fn new() -> Self {
Self {
ttl_opt: None,
t: PhantomData::default(),
t: PhantomData,
}
}

pub fn time_to_live(&self, ttl: Duration) -> Self {
Self {
ttl_opt: Some(ttl),
t: PhantomData::default(),
t: PhantomData,
}
}

Expand Down

0 comments on commit fb31f40

Please sign in to comment.