fix : OpenSSL's file descriptor is always 0 #623
Workflow file for this run
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
name: GO/C/C++ CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-on-ubuntu2004: | |
runs-on: ubuntu-20.04 | |
name: build on ubuntu-20.04 x86_64 | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.18.10' | |
- name: Install Compilers | |
run: | | |
sudo apt-get update | |
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-9 clang-9 linux-tools-common linux-tools-generic | |
for tool in "clang" "llc" "llvm-strip" | |
do | |
sudo rm -f /usr/bin/$tool | |
sudo ln -s /usr/bin/$tool-9 /usr/bin/$tool | |
done | |
shell: bash | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: | | |
make clean | |
make env | |
make nocore -j4 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | |
# version: v3.2.0 | |
# Optional: working directory, useful for monorepos | |
# working-directory: somedir | |
# Optional: golangci-lint command line arguments. | |
args: --disable-all -E errcheck | |
# Optional: show only new issues if it's a pull request. The default value is `false`. | |
# only-new-issues: true | |
# Optional: if set to true then the all caching functionality will be complete disabled, | |
# takes precedence over all other caching options. | |
# skip-cache: true | |
# Optional: if set to true then the action don't cache or restore ~/go/pkg. | |
# skip-pkg-cache: true | |
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build. | |
# skip-build-cache: true | |
- name: Build NOCORE | |
run: | | |
make clean | |
make env | |
make nocore | |
- name: Test | |
run: go test -v ./... | |
build-on-ubuntu2204: | |
runs-on: ubuntu-22.04 | |
name: build on ubuntu-22.04 x86_64 | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.18.10' | |
- name: Install Compilers | |
run: | | |
sudo apt-get update | |
sudo apt-get install --yes build-essential pkgconf libelf-dev llvm-14 clang-14 linux-tools-common linux-tools-generic | |
for tool in "clang" "llc" "llvm-strip" | |
do | |
sudo rm -f /usr/bin/$tool | |
sudo ln -s /usr/bin/$tool-14 /usr/bin/$tool | |
done | |
shell: bash | |
- uses: actions/checkout@v3 | |
- name: Build | |
run: | | |
make clean | |
make env | |
make -j8 | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | |
# version: v3.2.0 | |
# Optional: working directory, useful for monorepos | |
# working-directory: somedir | |
# Optional: golangci-lint command line arguments. | |
args: --disable-all -E errcheck | |
# Optional: show only new issues if it's a pull request. The default value is `false`. | |
# only-new-issues: true | |
# Optional: if set to true then the all caching functionality will be complete disabled, | |
# takes precedence over all other caching options. | |
# skip-cache: true | |
# Optional: if set to true then the action don't cache or restore ~/go/pkg. | |
# skip-pkg-cache: true | |
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build. | |
# skip-build-cache: true | |
- name: Build NOCORE | |
run: | | |
make clean | |
make env | |
make nocore | |
- name: Test | |
run: go test -v ./... | |
build-on-ubuntu2004-arm64: | |
runs-on: ubuntu-22.04 | |
name: build on ubuntu-22.04 arm64 | |
# Run steps on a matrix of 3 arch/distro combinations | |
strategy: | |
matrix: | |
include: | |
- arch: aarch64 | |
distro: ubuntu22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
set-safe-directory: '/source_code' | |
- name: Branch Name | |
run: | | |
echo running on branch ${{ github.ref_name }} | |
echo checkout directory ${GITHUB_WORKSPACE} | |
echo PWD directory ${PWD} | |
- name: Write File | |
uses: DamianReeves/write-file-action@v1.2 | |
with: | |
path: ./bin/release_notes.txt | |
contents: | | |
"just for CI" | |
write-mode: append | |
- uses: uraimo/run-on-arch-action@v2 | |
name: Build artifact | |
id: build | |
with: | |
arch: ${{ matrix.arch }} | |
distro: ${{ matrix.distro }} | |
# Not required, but speeds up builds | |
githubToken: ${{ github.token }} | |
# Create an artifacts directory | |
setup: | | |
mkdir -p "${PWD}/artifacts" | |
# Mount the artifacts directory as /artifacts in the container | |
dockerRunArgs: | | |
--volume "${PWD}/artifacts:/artifacts" | |
--volume "${GITHUB_WORKSPACE}:/source_code" | |
# Pass some environment variables to the container | |
env: | # YAML, but pipe character is necessary | |
artifact_name: ecapture-${{ steps.get_tags.outputs.VERSION }} | |
# The shell to run commands with in the container | |
shell: /bin/sh | |
# Install some dependencies in the container. This speeds up builds if | |
# you are also using githubToken. Any dependencies installed here will | |
# be part of the container image that gets cached, so subsequent | |
# builds don't have to re-install them. The image layer is cached | |
# publicly in your project's package repository, so it is vital that | |
# no secrets are present in the container state or logs. | |
install: | | |
uname -a | |
apt-get update | |
apt-get install --yes wget git golang build-essential pkgconf libelf-dev llvm-12 clang-12 linux-tools-generic linux-tools-common | |
# Produce a binary artifact and place it in the mounted volume | |
run: | | |
uname -a | |
date | |
export PATH=$PATH:/usr/local/bin | |
echo $PATH | |
for tool in "clang" "llc" "llvm-strip" | |
do | |
rm -f /usr/bin/$tool | |
ln -s /usr/bin/$tool-12 /usr/bin/$tool | |
done | |
clang --version | |
which bpftool | |
echo "cat /proc/1/cgroup:" | |
cat /proc/1/cgroup | |
echo "cat /proc/1/sched:" | |
cat /proc/1/sched | |
git config --global --add safe.directory /source_code | |
cd /source_code | |
echo "-------------------start: Create ecapture.tar.gz of Linux -------------------" | |
make env | |
make clean | |
make | |
echo "-------------------ecapture --help-------------------" | |
bin/ecapture -v | |
echo "-------------------create tar.gz file-------------------" | |
UNAME_M=`uname -m` | |
OUTPUT_DIR="./bin" | |
SNAPSHOT_VERSION=${{ steps.get_tags.outputs.VERSION }} | |
echo "#${SNAPSHOT_VERSION}#" | |
if [ -z "${SNAPSHOT_VERSION}" ]; then | |
SNAPSHOT_VERSION="v0.0.0" | |
fi | |
TAR_DIR=ecapture-${SNAPSHOT_VERSION}-linux-${UNAME_M} | |
RELEASE_NOTES=${OUTPUT_DIR}/release_notes.txt | |
OUT_ARCHIVE=${OUTPUT_DIR}/${artifact_name}-linux-${{ matrix.arch }}.tar.gz | |
mkdir -p ${TAR_DIR} | |
cp LICENSE ${TAR_DIR}/LICENSE | |
cp CHANGELOG.md ${TAR_DIR}/CHANGELOG.md | |
cp README.md ${TAR_DIR}/README.md | |
cp README_CN.md ${TAR_DIR}/README_CN.md | |
cp ${OUTPUT_DIR}/ecapture ${TAR_DIR}/ecapture | |
cp ${OUTPUT_DIR}/release_notes.txt ${TAR_DIR}/release_notes.txt | |
tar -czf ${OUT_ARCHIVE} ${TAR_DIR} | |
cp ${OUT_ARCHIVE} "/artifacts/" | |
echo "-------------------end: Create ecapture.tar.gz of Linux -------------------" | |
echo "-------------------start: Create ecapture.tar.gz of Android kernel CO:RE -------------------" | |
make env | |
make clean | |
ANDROID=1 make -j2 | |
echo "-------------------ecapture --help-------------------" | |
echo "bin/ecapture -v" | |
echo "-------------------create tar.gz file-------------------" | |
UNAME_M=`uname -m` | |
OUTPUT_DIR="./bin" | |
SNAPSHOT_VERSION=${{ steps.get_tags.outputs.VERSION }} | |
echo "#${SNAPSHOT_VERSION}#" | |
if [ -z "${SNAPSHOT_VERSION}" ]; then | |
SNAPSHOT_VERSION="v0.0.0" | |
fi | |
TAR_DIR=ecapture-${SNAPSHOT_VERSION}-android_gki-${UNAME_M} | |
RELEASE_NOTES=${OUTPUT_DIR}/release_notes.txt | |
OUT_ARCHIVE=${OUTPUT_DIR}/${artifact_name}-android_core-${{ matrix.arch }}.tar.gz | |
mkdir -p ${TAR_DIR} | |
cp LICENSE ${TAR_DIR}/LICENSE | |
cp CHANGELOG.md ${TAR_DIR}/CHANGELOG.md | |
cp README.md ${TAR_DIR}/README.md | |
cp README_CN.md ${TAR_DIR}/README_CN.md | |
cp ${OUTPUT_DIR}/ecapture ${TAR_DIR}/ecapture | |
cp ${OUTPUT_DIR}/release_notes.txt ${TAR_DIR}/release_notes.txt | |
tar -czf ${OUT_ARCHIVE} ${TAR_DIR} | |
cp ${OUT_ARCHIVE} "/artifacts/" | |
echo "-------------------end: Create ecapture.tar.gz of Android kernel CO:RE -------------------" | |
echo "Produced artifact at /artifacts/${artifact_name}" | |
- name: Show the artifact | |
# Items placed in /artifacts in the container will be in | |
# ${PWD}/artifacts on the host. | |
run: | | |
ls -al "${PWD}/artifacts" |