Skip to content

Commit

Permalink
[PLATFORM-1372]: Migrate bridge.rs to GHA (#145)
Browse files Browse the repository at this point in the history
* Implement CI/CD with GHA

* Refactor ci, cd and Makefile

* Add fmt-check task in makefile.toml

* Remove drone.yml

* Check package version in cd

* Remove build script

* Add pss as codeowners
  • Loading branch information
cottinisimone authored Nov 30, 2023
1 parent f8bb319 commit 8199f1e
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 395 deletions.
269 changes: 0 additions & 269 deletions .drone.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
* @primait/shared-services
29 changes: 29 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CD

on:
release:
types: [published]

env:
CARGO_TERM_COLOR: always

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@cargo-release
- uses: taiki-e/install-action@cargo-make
- name: Get version
run: |
VERSION=$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Check version
if: ${{ github.event.release.tag_name != env.VERSION }}
run: |
echo "Github ref tag [${{ github.event.release.tag_name }}] is different from Cargo.toml version [${{ env.VERSION }}]"
exit 1
- run: cargo login "$CARGO_AUTH_KEY"
env:
CARGO_AUTH_KEY: ${{ secrets.CARGO_AUTH_KEY }}
- run: cargo make release
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
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@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-make
- run: cargo make fmt-check
- run: cargo make clippy
- run: cargo make docs
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@v4
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-make
- run: cargo make 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') }}
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ reqwest-middleware = "0.2.3"
http = "0.2.9"

[dev-dependencies]
env_logger = "0"
flate2 = "1.0"
mockito = "1.0"
tokio = {version = "1.16", features = ["macros", "rt-multi-thread"]}
Expand Down
Loading

0 comments on commit 8199f1e

Please sign in to comment.