Skip to content

Commit

Permalink
ci:tests and rpm build check
Browse files Browse the repository at this point in the history
CI runs formatting spellcheck and unit tests.
packit build rpm for fedora and centos

    Signed-off-by: Sayan Paul <[email protected]>

Signed-off-by: Sayan Paul <[email protected]>
  • Loading branch information
say-paul committed Apr 16, 2024
1 parent 4192f7d commit c517c50
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 56 deletions.
65 changes: 9 additions & 56 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- main
- greenboot-rs
pull_request:

name: Continuous integration
Expand All @@ -22,20 +22,17 @@ jobs:
skip: "./docs/Gemfile.lock,./docs/_config.yml,./.github,./.git,./greenboot.spec,./dist"

fmt:
name: Rustfmt
name: Cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
args: --check --all

clippy:
name: Clippy
Expand Down Expand Up @@ -63,11 +60,13 @@ jobs:

build_and_test:
runs-on: ubuntu-latest
container: fedora:latest
container:
image: fedora:latest
options: --user root
steps:
- name: Install deps
run: |
dnf install -y make gcc git cargo rust git clevis
dnf install -y make gcc git cargo rust git grub2-efi grub2-efi-modules shim
- uses: actions/checkout@v3
with:
persist-credentials: false
Expand All @@ -91,51 +90,5 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: test
# This is primarily to ensure that changes to fdo_data.h are committed,
# which is critical for determining whether any stability changes were made
# during the PR review.
- name: Ensure building did not change any code
run: |
git diff --exit-code
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 'latest'
- name: Install commitlint dependencies
run: npm install commitlint
- uses: wagoid/commitlint-github-action@v5
env:
NODE_PATH: ${{ github.workspace }}/node_modules
with:
configFile: .github/commitlint.config.js
failOnWarnings: true

# manpages:
# name: Test man page generation
# runs-on: ubuntu-latest
# container: fedora:latest
# steps:
# - uses: actions/checkout@v3
# - name: install deps
# run: |
# dnf install -y make python3-docutils
# - name: generate man pages
# run: make man

# devcontainer_test:
# name: Test Devcontainer Creation
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Install devcontainer CLI
# run: npm install -g @vscode/dev-container-cli
# - name: Build devcontainer
# run: devcontainer build --image-name devcontainer-fdo-rs .
# - name: Test building in devcontainer
# run: docker run --rm -v `pwd`:/code:z --workdir /code --user root devcontainer-fdo-rs cargo build --verbose
args: -- --test-threads=1

2 changes: 2 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ srpm_build_deps:
# post-upstream-clone: "./tools/rpm_spec_add_provides_bundle.sh"

actions:
get-current-version:
- grep -oP '^Version:\s+\K\S+' greenboot.spec
create-archive:
- "cargo vendor vendor"
- bash -c "git archive --prefix=greenboot-${PACKIT_PROJECT_VERSION}/ --format=tar HEAD > greenboot-${PACKIT_PROJECT_VERSION}.tar"
Expand Down

0 comments on commit c517c50

Please sign in to comment.