Skip to content

Commit

Permalink
build: fix release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
hseeberger committed Jan 1, 2024
1 parent ec8d606 commit 6a0ebe6
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: release-hello-tracing-backend
on:
push:
tags:
- v*
- hello-tracing-backend-v*

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
94 changes: 79 additions & 15 deletions .github/workflows/release-gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@ on:
tags:
- hello-tracing-gateway-v*

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
release:
check:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install Rust toolchain
run: |
toolchain=$(grep channel rust-toolchain.toml | sed -r 's/channel = "(.*)"/\1/')
echo "installing toolchain $toolchain from rust-toolchain.toml"
rm /home/runner/.cargo/bin/rustfmt
rustup toolchain install $toolchain --profile minimal
rustup component add --toolchain $toolchain rustfmt
rustup component add --toolchain $toolchain clippy
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install just
uses: taiki-e/install-action@v2
Expand All @@ -31,18 +28,85 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
- uses: Swatinem/rust-cache@v2

- name: just check
run: just check

- name: Check code format
fmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust (nightly for fmt)
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt

- name: Install just
uses: taiki-e/install-action@v2
with:
tool: just

- uses: Swatinem/rust-cache@v2

- name: just fmt-check
run: just fmt-check

- name: Run linter
lint:
runs-on: ubuntu-latest
needs: [check, fmt-check]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Install just
uses: taiki-e/install-action@v2
with:
tool: just

- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: Swatinem/rust-cache@v2

- name: just lint
run: just lint

- name: Run tests
test:
runs-on: ubuntu-latest
needs: [check, fmt-check]
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install just
uses: taiki-e/install-action@v2
with:
tool: just

- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: Swatinem/rust-cache@v2

- name: just test
run: just test

release:
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Determine version
id: version
run: |
Expand Down

0 comments on commit 6a0ebe6

Please sign in to comment.