13 - uses: actions/checkout@v3
15 - name: Install rustfmt
17 rustup component add rustfmt
24 runs-on: ${{ matrix.os }}
33 # cross-compile from Linux to Windows using mingw
36 TARGET_TRIPLE: x86_64-pc-windows-gnu
39 TARGET_TRIPLE: aarch64-unknown-linux-gnu
42 - uses: actions/checkout@v3
44 - name: Cache cargo installed crates
45 uses: actions/cache@v2
48 key: ${{ runner.os }}-cargo-installed-crates
50 - name: Cache cargo registry and index
51 uses: actions/cache@v2
56 key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
58 - name: Cache cargo target dir
59 uses: actions/cache@v2
62 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
64 - name: Install MinGW toolchain and wine
65 if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
68 sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
69 rustup target add x86_64-pc-windows-gnu
71 - name: Install AArch64 toolchain and qemu
72 if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'aarch64-unknown-linux-gnu'
75 sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user
77 - name: Prepare dependencies
79 git config --global user.email "user@example.com"
80 git config --global user.name "User"
83 - name: Build without unstable features
85 TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
86 # This is the config rust-lang/rust uses for builds
87 run: ./y.rs build --no-unstable-features
90 run: ./y.rs build --sysroot none
94 TARGET_TRIPLE: ${{ matrix.env.TARGET_TRIPLE }}
96 # Enable backtraces for easier debugging
97 export RUST_BACKTRACE=1
99 # Reduce amount of benchmark runs as they are slow
100 export COMPILE_RUNS=2
103 # Enable extra checks
104 export CG_CLIF_ENABLE_VERIFIER=1
108 - name: Package prebuilt cg_clif
109 run: tar cvfJ cg_clif.tar.xz build
111 - name: Upload prebuilt cg_clif
112 if: matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
113 uses: actions/upload-artifact@v2
115 name: cg_clif-${{ runner.os }}
118 - name: Upload prebuilt cg_clif (cross compile)
119 if: matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
120 uses: actions/upload-artifact@v2
122 name: cg_clif-${{ runner.os }}-cross-x86_64-mingw
126 runs-on: windows-latest
130 - uses: actions/checkout@v3
132 #- name: Cache cargo installed crates
133 # uses: actions/cache@v2
136 # key: ${{ runner.os }}-cargo-installed-crates
138 #- name: Cache cargo registry and index
139 # uses: actions/cache@v2
144 # key: ${{ runner.os }}-cargo-registry-and-index-${{ hashFiles('**/Cargo.lock') }}
146 #- name: Cache cargo target dir
147 # uses: actions/cache@v2
150 # key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
152 - name: Prepare dependencies
154 git config --global user.email "user@example.com"
155 git config --global user.name "User"
156 git config --global core.autocrlf false
157 rustup set default-host x86_64-pc-windows-gnu
158 rustc y.rs -o y.exe -g
164 # Enable backtraces for easier debugging
165 #export RUST_BACKTRACE=1
167 # Reduce amount of benchmark runs as they are slow
168 #export COMPILE_RUNS=2
171 # Enable extra checks
172 #export CG_CLIF_ENABLE_VERIFIER=1
176 - name: Package prebuilt cg_clif
177 # don't use compression as xzip isn't supported by tar on windows and bzip2 hangs
178 run: tar cvf cg_clif.tar build
180 - name: Upload prebuilt cg_clif
181 uses: actions/upload-artifact@v2
183 name: cg_clif-${{ runner.os }}