Skip to content

Commit

Permalink
Add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanosio committed Jul 8, 2021
1 parent 2cb5c79 commit ac0091b
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: CI

on:
push:
branches: [ zephyr-binutils-2_35 ]
pull_request:
branches: [ zephyr-binutils-2_35 ]
release:
types: [ published ]

jobs:
build:
name: Build ${{ matrix.target }}
runs-on: [ self-hosted, linux, x64, large ]

strategy:
fail-fast: false
matrix:
target:
- arc-none-elf
# - arc64-none-elf
- arm-none-eabi
- aarch64-none-elf
- mips-none-elf
- nios2-none-elf
- riscv64-none-elf
- sparc-none-elf
- x86_64-none-elf
- xtensa-none-elf

steps:
- name: Print environment information
run: |
uname -a
df -h
gcc --version
ld --version
make --version
autoconf --version
automake --version
cmake --version
flex --version
bison --version
- name: Check out source code
uses: actions/checkout@v2
with:
path: src

- name: Create work directories
run: |
rm -rf build
mkdir build
rm -rf ${{ matrix.target }}
mkdir ${{ matrix.target }}
rm -rf upload
mkdir upload
- name: Configure binutils
run: |
cd build
../src/configure \
--prefix=/ \
--target=${{ matrix.target }} \
--enable-ld=yes \
--enable-gold=no \
--enable-deterministic-archives \
--enable-multilib \
--disable-sim \
--disable-gdb \
--disable-nls
- name: Build binutils
run: |
cd build
make -j16 all
make DESTDIR=${GITHUB_WORKSPACE}/${{ matrix.target }} install-strip
- name: Archive artifact
run: |
cd upload
tar -zcvf ${{ matrix.target }}.tar.gz --owner=0 --group=0 \
-C .. ${{ matrix.target }}
- name: Upload artifact
if: github.event_name != 'release'
uses: actions/upload-artifact@v2
with:
name: binutils_${{ matrix.target }}
path: upload/${{ matrix.target }}.tar.gz

- name: Upload release asset
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: upload/${{ matrix.target }}.tar.gz
asset_name: ${{ matrix.target }}.tar.gz
asset_content_type: application/octet-stream

0 comments on commit ac0091b

Please sign in to comment.