Skip to content

CI fixes

CI fixes #12

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.TARGET.OS }}
strategy:
fail-fast: false
matrix:
TARGET:
- {
OS: 'ubuntu-20.04',
CFLAGS: '-static -std=gnu89 -m32',
HOST: 'i386-pc-linux',
ARCHIVE_NAME: 'mips-gcc-egcs-2.91.66-linux.tar.gz'
}
# - {
# OS: 'macos-latest',
# CFLAGS: '-DDARWIN -std=gnu89 -Wno-return-type -Wno-error -Wno-implicit-function-declaration',
# HOST: 'i386-apple-darwin',
# ARCHIVE_NAME: 'mips-gcc-egcs-2.91.66-mac.tar.gz'
# }
name: Building gcc for ${{ matrix.TARGET.OS }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Ubuntu)
shell: bash
if: matrix.TARGET.OS == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y build-essential bison file gperf gcc gcc-multilib autoconf
- name: Configure for mips
shell: bash
run: |
./configure --target=mips-linux --prefix=/opt/cross --with-gnu-as --disable-gprof --disable-gdb --disable-werror --host=${{ matrix.TARGET.HOST }} --build=${{ matrix.TARGET.HOST }}
- name: Make
shell: bash
run: | # The generated `c-parse.c` is already commited on the repo, so we touch it to avoid regenerating it (trying to build old lex/yacc files with modern tools fails)
touch c-parse.c
make -C gcc CFLAGS="${{ matrix.TARGET.CFLAGS }}" xgcc cc1 cc1plus cpp cccp g++
- name: Test for file
shell: bash
run: |
test -f gcc/cc1
file gcc/cc1
./gcc/cc1 test.c
- name: Create release archive
shell: bash
run: |
cd gcc
cp xgcc gcc
chmod +x gcc
chmod +x cc1
chmod +x cc1plus
chmod +x cccp
chmod +x cpp
chmod +x g++
tar -czf ../${{ matrix.TARGET.ARCHIVE_NAME }} gcc cc1 cc1plus cpp cccp g++
cd ..
- name: Upload archive
uses: actions/upload-artifact@v3
with:
name: mips-gcc-egcs-2.91.66-${{ matrix.TARGET.OS }}
path: |
${{ matrix.TARGET.ARCHIVE_NAME }}
- name: Publish release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ matrix.TARGET.ARCHIVE_NAME }}