CI #200
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
gen_tag: | |
runs-on: ubuntu-latest | |
outputs: | |
TAG: ${{ steps.gen.outputs.TAG }} | |
TIME: ${{ steps.gen.outputs.TIME }} | |
steps: | |
- name: gen | |
id: gen | |
run: | | |
echo "TAG=$(dd if=/dev/urandom bs=32 count=1 2>/dev/null | hexdump -n 4 -e '4/1 "%02x " "\n"' | tr -d ' \n' )" >> "$GITHUB_OUTPUT" | |
echo "TIME=$(date +%Y%m%d%H%M%S)" >> "$GITHUB_OUTPUT" | |
build: | |
runs-on: ubuntu-latest | |
needs: gen_tag | |
container: | |
image: ghcr.io/eebssk1/bbk/debian-bookworm:latest | |
volumes: | |
- /root:/user | |
env: | |
TAG: ${{ needs.gen_tag.outputs.TAG }} | |
TIME: ${{ needs.gen_tag.outputs.TIME }} | |
strategy: | |
matrix: | |
target: [linux-native, mingw64-win, mingw64-cross, mingw64-legacy-cross, arm64-cross, arm32-cross, mingw64-legacy-super-cross, musl-cross] | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v4 | |
- name: swap | |
run: exec ./swap.sh | |
- name: checkout binutils | |
uses: actions/checkout@v4 | |
with: | |
repository: "eebssk1/m_binutils" | |
path: "./m_binutils" | |
- name: checkout gcc | |
uses: actions/checkout@v4 | |
with: | |
repository: "eebssk1/m_gcc" | |
path: "./m_gcc" | |
- name: enable ccache | |
uses: hendrikmuhs/[email protected] | |
with: | |
verbose: 1 | |
max-size: "1872M" | |
key: t_${{ matrix.target }} | |
- name: build | |
run: exec stdbuf -oL ./exec.sh ${{ matrix.target }} | |
- name: log rename | |
run: mv out.log stdout_${{ matrix.target }}.log || true | |
- name: collect config log | |
if: (!cancelled()) | |
run: exec ./logtar.sh | |
- name: upload result | |
uses: actions/upload-artifact@v4 | |
with: | |
name: result_${{ matrix.target }} | |
path: | | |
./*native.tb2 | |
./*cross*.tb2 | |
- name: upload debug output | |
if: (!cancelled()) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debug_${{ matrix.target }} | |
path: | | |
./conflogs*.tgz | |
./curouts*.tgz | |
./stdout_*.log | |
- name: release | |
uses: ncipollo/[email protected] | |
with: | |
allowUpdates: true | |
artifacts: "*native.tb2,*cross*.tb2,conflogs*.tgz,onelog.txt,stdout_*.log" | |
commit: main | |
makeLatest: true | |
tag: ${{ env.TAG }} | |
name: ${{ env.TAG }}_${{ env.TIME }} | |
bodyFile: notes.txt | |
build-msys: | |
runs-on: windows-latest | |
needs: gen_tag | |
env: | |
TAG: ${{ needs.gen_tag.outputs.TAG }} | |
TIME: ${{ needs.gen_tag.outputs.TIME }} | |
NO_TC_DOWN: 1 | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: setup msys2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: UCRT64 | |
install: mingw-w64-ucrt-x86_64-toolchain python git gmp-devel mpfr-devel mpc-devel isl-devel zlib-devel libzstd-devel bison flex diffutils make | |
update: true | |
location: C:\ | |
- run: git config --global core.autocrlf input | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: build | |
run: exec ./exec.sh mingw64-msys2 | |
- name: upload result | |
uses: actions/upload-artifact@v4 | |
with: | |
name: result_mingw64-msys2 | |
path: | | |
./*native.tb2 | |
./*cross*.tb2 | |
- name: collect config log | |
if: (!cancelled()) | |
run: exec ./logtar.sh | |
- name: upload debug output | |
if: (!cancelled()) | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debug_mingw64-msys2 | |
path: | | |
./conflogs*.tgz | |
./curouts*.tgz | |
./stdout_*.log | |
- name: release | |
uses: ncipollo/[email protected] | |
with: | |
allowUpdates: true | |
artifacts: "*native.tb2,*cross*.tb2,conflogs*.tgz,onelog.txt,stdout_*.log" | |
commit: main | |
makeLatest: true | |
tag: ${{ env.TAG }} | |
name: ${{ env.TAG }}_${{ env.TIME }} |