From 0b096f4164fdac9e7b7d186e3ca72f52906dff72 Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Thu, 20 Aug 2020 20:28:07 +1200 Subject: CI: Create continuous-integration-workflow.yml Create a continuous integration workflow that builds a few sample configurations. Future improvements would be to have a single job that builds ct-ng and shares the artifacts with the matrix jobs for building the individual toolchains. It would also be a good idea to fetch and cache the various source tarballs. Signed-off-by: Chris Packham diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml new file mode 100644 index 0000000..fc40389 --- /dev/null +++ b/.github/workflows/continuous-integration-workflow.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + sample: [ + "arm-unknown-linux-gnueabi", + "aarch64-unknown-linux-gnu", + "mips-unknown-elf", + "powerpc64-unknown-linux-gnu", + "powerpc-unknown-linux-gnu", + "x86_64-multilib-linux-uclibc" + ] + steps: + - name: "clone" + uses: actions/checkout@v2 + - name: "prereq" + run: | + sudo apt-get install -y gcc g++ gperf bison flex texinfo help2man \ + make libncurses5-dev python3-dev autoconf \ + automake libtool libtool-bin gawk wget bzip2 \ + xz-utils unzip patch libstdc++6 rsync + - name: "build ct-ng" + run: | + ./bootstrap + ./configure --enable-local + make + - name: "build ${{ matrix.sample }}" + run: | + mkdir -p src + ./ct-ng ${{ matrix.sample }} + sed -i -e '/CT_LOG_PROGRESS_BAR/s/y$/n/' .config + sed -i -e '/CT_LOCAL_TARBALLS_DIR/s/HOME/CT_TOP_DIR/' .config + sed -i -e '/CT_PREFIX_DIR/s/HOME/CT_TOP_DIR/' .config + sed -i -e '/CT_LOG_EXTRA/d' .config + sed -i -e '/CT_LOG_LEVEL_MAX/d' .config + echo 'CT_LOG_ALL=y' >>.config + echo 'CT_LOG_LEVEL_MAX="ALL"' >>.config + ./ct-ng build -- cgit v0.10.2-6-g49f6 From 0a4bed1a92ebc52ff31b29672b39aca4ad223f62 Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Sun, 23 Aug 2020 11:45:41 +1200 Subject: CI: Only install packages not already present The GitHub runners have most of the required packages installed already. Only install the 3 extra that we need for ct-ng. Signed-off-by: Chris Packham diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index fc40389..e2d724e 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -22,10 +22,7 @@ jobs: uses: actions/checkout@v2 - name: "prereq" run: | - sudo apt-get install -y gcc g++ gperf bison flex texinfo help2man \ - make libncurses5-dev python3-dev autoconf \ - automake libtool libtool-bin gawk wget bzip2 \ - xz-utils unzip patch libstdc++6 rsync + sudo apt-get install -y gperf help2man libtool-bin - name: "build ct-ng" run: | ./bootstrap -- cgit v0.10.2-6-g49f6 From d52c897a719badfb503ef1d9c157728d9bc4593a Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Sun, 23 Aug 2020 11:56:20 +1200 Subject: CI: upload build logs as artifacts Upload the config.log from building ct-ng as well as build.log and .config from the toolchain builds. Signed-off-by: Chris Packham diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index e2d724e..33e00d6 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -28,6 +28,12 @@ jobs: ./bootstrap ./configure --enable-local make + - name: "upload config.log" + uses: actions/upload-artifact@v2 + with: + name: config.log + path: config.log + if: ${{ always() }} - name: "build ${{ matrix.sample }}" run: | mkdir -p src @@ -40,3 +46,11 @@ jobs: echo 'CT_LOG_ALL=y' >>.config echo 'CT_LOG_LEVEL_MAX="ALL"' >>.config ./ct-ng build + - name: "upload log" + uses: actions/upload-artifact@v2 + with: + name: "${{ matrix.sample }}.log" + path: | + build.log + .config + if: ${{ always() }} -- cgit v0.10.2-6-g49f6 From d9791f4fcb74a6d8fd44684f666d727fd46ab3fb Mon Sep 17 00:00:00 2001 From: Chris Packham Date: Mon, 24 Aug 2020 20:38:36 +1200 Subject: CI: Build ct-ng once Build ct-ng once and use the result to build the toolchains. Signed-off-by: Chris Packham diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml index 33e00d6..97df813 100644 --- a/.github/workflows/continuous-integration-workflow.yml +++ b/.github/workflows/continuous-integration-workflow.yml @@ -5,18 +5,8 @@ on: pull_request: jobs: - build: + crosstool: runs-on: ubuntu-latest - strategy: - matrix: - sample: [ - "arm-unknown-linux-gnueabi", - "aarch64-unknown-linux-gnu", - "mips-unknown-elf", - "powerpc64-unknown-linux-gnu", - "powerpc-unknown-linux-gnu", - "x86_64-multilib-linux-uclibc" - ] steps: - name: "clone" uses: actions/checkout@v2 @@ -26,18 +16,51 @@ jobs: - name: "build ct-ng" run: | ./bootstrap - ./configure --enable-local + ./configure --prefix=$PWD/.local/ make + make install + tar -cf ct-ng.tar .local/ + - name: "upload ct-ng" + uses: actions/upload-artifact@v2 + with: + name: crosstool + path: ct-ng.tar - name: "upload config.log" uses: actions/upload-artifact@v2 with: name: config.log path: config.log if: ${{ always() }} + + toolchains: + needs: crosstool + runs-on: ubuntu-latest + strategy: + matrix: + sample: [ + "arm-unknown-linux-gnueabi", + "aarch64-unknown-linux-gnu", + "mips-unknown-elf", + "powerpc64-unknown-linux-gnu", + "powerpc-unknown-linux-gnu", + "x86_64-multilib-linux-uclibc" + ] + steps: + - name: "download ct-ng" + uses: actions/download-artifact@v2 + with: + name: crosstool + - name: "extract ct-ng" + run: | + tar -xf ct-ng.tar + - name: "prereq" + run: | + sudo apt-get install -y gperf help2man libtool-bin + echo "::add-path::$GITHUB_WORKSPACE/.local/bin" - name: "build ${{ matrix.sample }}" run: | mkdir -p src - ./ct-ng ${{ matrix.sample }} + ct-ng ${{ matrix.sample }} sed -i -e '/CT_LOG_PROGRESS_BAR/s/y$/n/' .config sed -i -e '/CT_LOCAL_TARBALLS_DIR/s/HOME/CT_TOP_DIR/' .config sed -i -e '/CT_PREFIX_DIR/s/HOME/CT_TOP_DIR/' .config @@ -45,7 +68,7 @@ jobs: sed -i -e '/CT_LOG_LEVEL_MAX/d' .config echo 'CT_LOG_ALL=y' >>.config echo 'CT_LOG_LEVEL_MAX="ALL"' >>.config - ./ct-ng build + ct-ng build - name: "upload log" uses: actions/upload-artifact@v2 with: -- cgit v0.10.2-6-g49f6