diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..24cfb50b9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,34 @@ +name: build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + if: ${{ github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' }} + runs-on: ubuntu-20.04 + steps: + - name: Checkout this repo + uses: actions/checkout@v2 + + - name: Checkout tools + uses: actions/checkout@v2 + with: + repository: mattbruv/bfbb-private + token: ${{ secrets.PRIVATE_REPO_ACCESS }} + path: bfbb-tools + - name: Decrypt tools + run: echo ${{ secrets.BFBB_TOOLS }} | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in bfbb-tools/bfbb.tar.gz.aes -out bfbb.tar.gz + - name: Extract tools + run: tar xvzf bfbb.tar.gz + - name: Compile + uses: docker://docker.io/markstreet/bfbbdecomp:latest + with: + args: make --jobs + - name: Clang Format + uses: docker://docker.io/markstreet/bfbbdecomp:latest + with: + args: sh -c "clang-format -i -style=file src/**/*.cpp || echo \"::warning clang-formatter check failed\"" diff --git a/.github/workflows/build_pr.yml b/.github/workflows/build_pr.yml new file mode 100644 index 000000000..e82dbc289 --- /dev/null +++ b/.github/workflows/build_pr.yml @@ -0,0 +1,34 @@ +name: build_pr + +on: + pull_request_target: + branches: [ master ] + +jobs: + build_pr: + if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} + runs-on: ubuntu-20.04 + steps: + - name: Checkout this repo + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + - name: Checkout tools + uses: actions/checkout@v2 + with: + repository: mattbruv/bfbb-private + token: ${{ secrets.PRIVATE_REPO_ACCESS }} + path: bfbb-tools + - name: Decrypt tools + run: echo ${{ secrets.BFBB_TOOLS }} | openssl enc -d -aes-256-cbc -pass stdin -pbkdf2 -in bfbb-tools/bfbb.tar.gz.aes -out bfbb.tar.gz + - name: Extract tools + run: tar xvzf bfbb.tar.gz + - name: Compile + uses: docker://docker.io/markstreet/bfbbdecomp:latest + with: + args: make --jobs + - name: Clang Format + uses: docker://docker.io/markstreet/bfbbdecomp:latest + with: + args: sh -c "clang-format -i -style=file src/**/*.cpp || echo \"::warning clang-formatter check failed\"" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..d0408c45a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM ubuntu:20.04 + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -y \ + build-essential \ + clang-format \ + python3 \ + wget \ + wine + +RUN dpkg --add-architecture i386 && \ + apt-get update && apt-get install -y wine32 + +RUN wget https://github.com/devkitPro/pacman/releases/download/v1.0.2/devkitpro-pacman.amd64.deb \ + -O devkitpro.deb && \ + echo ebc9f199da9a685e5264c87578efe29309d5d90f44f99f3dad9dcd96323fece3 devkitpro.deb | sha256sum --check && \ + apt install -y ./devkitpro.deb && \ + rm devkitpro.deb + +RUN dkp-pacman -Syu gamecube-dev --noconfirm + +RUN mkdir /bfbbdecomp +WORKDIR /bfbbdecomp + +ENV DEVKITPRO=/opt/devkitpro +ENV DEVKITPPC=/opt/devkitpro/devkitPPC + +ENV MWCIncludes="C:\\" +ENV MWLibraries="C:\\" +ENV MWLibraryFiles="C:\\" +ENV Path=/bfbbdecomp/tools/mwcc_compiler/2.0/ +# this is a hack for github actions, use '-e WINEPREFIX /root/.wine' locally +ENV WINEPREFIX=/bfbbdecomp/.wine