build.yaml 1.4 KB
Newer Older
1
name: Build
Kevin Park's avatar
Kevin Park 已提交
2
3
4
5
6

on:
  push:
    branches:
      - master
7
8
9
  pull_request:
    branches:
      - master
Kevin Park's avatar
Kevin Park 已提交
10
11

jobs:
12
  build:
Xing GUO's avatar
Xing GUO 已提交
13
14
15
16
17
18
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:     [ubuntu-18.04, ubuntu-20.04]
        mode:   [newlib, linux]
        target: [rv32gc-ilp32d, rv64gc-lp64d]
Kevin Park's avatar
Kevin Park 已提交
19
20
21
22
23
24
25
    steps:
      - uses: actions/checkout@v2

      - name: initialize submodules
        run: |
          git submodule init
          git submodule update --recursive --progress --recommend-shallow
Kito Cheng's avatar
Kito Cheng 已提交
26

Kevin Park's avatar
Kevin Park 已提交
27
28
29
      - name: install dependencies
        run: sudo ./.github/setup-apt.sh

Xing GUO's avatar
Xing GUO 已提交
30
      - name: build toolchain
Kevin Park's avatar
Kevin Park 已提交
31
        run: |
Xing GUO's avatar
Xing GUO 已提交
32
33
34
          TARGET_TUPLE=($(echo ${{ matrix.target }} | tr "-" "\n"))
          ./configure --prefix=/opt/riscv --with-arch=${TARGET_TUPLE[0]} --with-abi=${TARGET_TUPLE[1]}
          sudo make -j $(nproc) ${{ matrix.mode }}
Kevin Park's avatar
Kevin Park 已提交
35
36
37
38

      - name: tarball build
        run: tar czvf riscv.tar.gz -C /opt/ riscv/

Xing GUO's avatar
Xing GUO 已提交
39
40
      - name: generate prebuilt toolchain name
        id:   toolchain-name-generator
Kevin Park's avatar
Kevin Park 已提交
41
        run: |
Xing GUO's avatar
Xing GUO 已提交
42
43
44
          if [[ "${{ matrix.target }}" == *"32"* ]]; then BITS=32; else BITS=64; fi
          if [[ "${{ matrix.mode }}" == "linux" ]]; then MODE="glibc"; else MODE="elf"; fi
          echo ::set-output name=TOOLCHAIN_NAME::riscv$BITS-$MODE-${{ matrix.os }}-nightly
Kevin Park's avatar
Kevin Park 已提交
45
46
47

      - uses: actions/upload-artifact@v2
        with:
Xing GUO's avatar
Xing GUO 已提交
48
          name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
49
          path: riscv.tar.gz