-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ce9cde
commit 200eb8c
Showing
6 changed files
with
132 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
on: | ||
workflow_call: | ||
secrets: | ||
DOCKERHUB_USERNAME: | ||
required: true | ||
DOCKERHUB_TOKEN: | ||
required: true | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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 | ||
secrets: | ||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | ||
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM alpine | ||
CMD ["/bin/sh", "-c", "echo 'It works!'"] |