Skip to content

Commit

Permalink
Fix branch name in release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
liamadamson committed Nov 22, 2023
1 parent 0ce9cde commit 260ac67
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 66 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/check_and_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
on:
workflow_call:
name: Main workflow
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Run check
run: cargo check --verbose --all --all-features
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
override: true
components: rustfmt
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Run fmt
run: cargo fmt --all --check --verbose
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
override: true
components: clippy
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Run clippy
run: cargo clippy
29 changes: 29 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
workflow_call:
name: Docker build and publish
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: liamadamson/room-monitor:latest
72 changes: 6 additions & 66 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,71 +1,11 @@
on:
push:
branches-ignore:
- main
pull_request:
name: Main workflow
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Run tests
run: cargo test --verbose --all --all-features
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Run check
run: cargo check --verbose --all --all-features
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
override: true
components: rustfmt
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Run fmt
run: cargo fmt --all --check --verbose
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
override: true
components: clippy
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Run clippy
run: cargo clippy
check-and-lint:
uses: ./.github/workflows/check_and_lint.yml
test:
uses: ./.github/workflows/test.yml
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
on:
push:
branches:
- main
name: Release
jobs:
check-and-lint:
uses: ./.github/workflows/check_and_lint.yml
test:
uses: ./.github/workflows/test.yml
docker-release:
needs: [check-and-lint, test]
uses: ./.github/workflows/docker.yml
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on:
workflow_call:
name: Tests
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable

- uses: Swatinem/rust-cache@v2

- name: Run tests
run: cargo test --verbose --all --all-features

0 comments on commit 260ac67

Please sign in to comment.