Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github/workflows/main.yml: run CI on dasharo branches #4

Open
wants to merge 8 commits into
base: dasharo-release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/create_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [fedora, debian-x86_64, arch, debian-i386, void]
os: [ubuntu-20.04]

steps:
- name: Check out the repo
Expand All @@ -32,5 +32,5 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: fwupd/fwupd/fwupd-${{matrix.os}}
repository: dasharo/fwupd/fwupd-${{matrix.os}}
tags: latest
82 changes: 26 additions & 56 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,18 @@
name: Continuous Integration
on:
push:
branches: [ main ]
branches: [ dasharo-release ]
pull_request:
branches: [ main ]
branches:
- dasharo-develop
- dasharo-release

jobs:
pre-commit:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Refresh dependencies
run: sudo apt update
- name: Install dependencies
run: sudo apt install shellcheck clang-format -y
- name: Run pre-commit hooks
run: |
./contrib/setup
source venv/bin/activate
sed -i "/no-commit-to-branch/,+1d" .pre-commit-config.yaml
pre-commit run --hook-stage commit --all-files
abi:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Refresh dependencies
run: sudo apt update
- name: Install dependencies
run: sudo ./contrib/ci/fwupd_setup_helpers.py install-dependencies -o ubuntu --yes
- name: Check ABI
run: ./contrib/ci/check-abi $(git describe --abbrev=0 --tags) $(git rev-parse HEAD)

build:
runs-on: ubuntu-latest
runs-on: [self-hosted, builder]
strategy:
matrix:
os: [fedora, debian-x86_64, arch, debian-i386, void]
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- name: Docker login
Expand All @@ -52,28 +25,25 @@ jobs:
CI: true
run: |
echo $GITHUB_WORKSPACE
docker run --privileged -e CI=true -t -v $GITHUB_WORKSPACE:/github/workspace docker.pkg.github.com/fwupd/fwupd/fwupd-${{matrix.os}}:latest
mkdir tss
docker run -e CI=false -t -v tss:/usr/include/tss -v $GITHUB_WORKSPACE:/github/workspace docker.pkg.github.com/dasharo/fwupd/fwupd-${{matrix.os}}:latest

fuzzing:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'fwupd'
dry-run: false
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'fwupd'
fuzz-seconds: 300
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@v1
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
- name: Save build artifacts
uses: actions/upload-artifact@v2
with:
name: dasharo-fwupd
path: |
dist/
retention-days: 7

- name: Get Actions user id
id: get_uid
run: |
actions_user_id=`id -u $USER`
echo $actions_user_id
echo ::set-output name=uid::$actions_user_id

- name: Correct Ownership in GITHUB_WORKSPACE directory
uses: peter-murray/reset-workspace-ownership-action@v1
with:
user_id: ${{ steps.get_uid.outputs.uid }}
4 changes: 2 additions & 2 deletions contrib/ci/Dockerfile-ubuntu.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ubuntu:devel
FROM ubuntu:20.04
%%%OS%%%
ENV CI_NETWORK true
ENV CC clang
RUN echo fubar > /etc/machine-id
%%%ARCH_SPECIFIC_COMMAND%%%
%%%INSTALL_DEPENDENCIES_COMMAND%%%
WORKDIR /github/workspace
CMD ["./contrib/ci/ubuntu.sh"]
CMD ["./contrib/ci/debian.sh"]
13 changes: 7 additions & 6 deletions contrib/ci/debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,19 @@ lintian ../*changes \
--suppress-tags arch-dependent-file-not-in-arch-specific-directory \
--allow-root

PACKAGES=$(find .. -type f -name "*.deb" | grep -v 'fwupd-tests\|dbgsym')

#place built packages in dist outside docker
mkdir -p ../dist
cp $PACKAGES ../dist

#if invoked outside of CI
if [ ! -f /.dockerenv ]; then
if [ ! -f /.dockerenv || ! "$CI" = "true" ]; then
echo "Not running in a container, please manually install packages"
exit 0
fi

#test the packages install
PACKAGES=$(find .. -type f -name "*.deb" | grep -v 'fwupd-tests\|dbgsym')
dpkg -i $PACKAGES

# copy in more non-generated data
Expand All @@ -96,7 +101,3 @@ apt purge -y fwupd \
fwupd-doc \
libfwupd2 \
libfwupd-dev

#place built packages in dist outside docker
mkdir -p ../dist
cp $PACKAGES ../dist
Loading