Skip to content

Change default log level to info #18

Change default log level to info

Change default log level to info #18

Workflow file for this run

name: Continuous Integration
on:
push:
branches: ["master"]
tags: ["v*"]
pull_request:
branches: ["master"]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Enable caching
uses: Swatinem/rust-cache@v2
- name: Run fmt command
run: cargo fmt --all -- --check --color always
- name: Run clippy command
run: cargo clippy --all-targets --all-features --workspace -- -D warnings
deploy:
if: github.ref_type == 'tag'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
env:
PACKAGE_NAME: ${{github.event.repository.name}}-${{matrix.chip}}-${{github.ref_name}}
strategy:
matrix:
chip: ["nrf52840"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Validate version
run: |
export CARGO_VERSION=v$(awk '/^version/ {print $3}' Cargo.toml | head -1 | tr -d '"')
export GIT_VERSION=${{github.ref_name}}
echo "Cargo version: $CARGO_VERSION"
echo "Git version: $GIT_VERSION"
if [[ "${CARGO_VERSION}" != "$GIT_VERSION" ]]; then
echo "Tag version and Cargo.toml version don't match" 1>&2
exit 1
fi
- name: Enable caching
uses: Swatinem/rust-cache@v2
- name: Run build command
env:
DEFMT_LOG: info
run: cargo build --release
- name: Package
run: |
mkdir $PACKAGE_NAME
cp target/thumbv7em-none-eabihf/release/tempsys-firmware ${PACKAGE_NAME}/
cp -r README.md LICENSE $PACKAGE_NAME/
tar -czvf ${PACKAGE_NAME}.tar.gz $PACKAGE_NAME
- name: Publish release
uses: ghalactic/github-release-from-tag@v5
with:
generateReleaseNotes: "true"
assets: |
- path: ${{env.PACKAGE_NAME}}.tar.gz