Skip to content

Commit

Permalink
Add CI (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpitasky authored Jan 5, 2025
1 parent 6aac306 commit 4d7a793
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build
on: [push]
jobs:
build:
# Set the job to run on the platform specified by the matrix below
runs-on: ${{ matrix.runner }}

# Define the build matrix for cross-compilation
strategy:
matrix:
include:
- name: linux-amd64
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
- name: win-amd64
runner: windows-latest
target: x86_64-pc-windows-msvc
- name: macos-amd64
runner: macos-latest
target: x86_64-apple-darwin
- name: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin

# The steps to run for each matrix item
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: "${{ matrix.target }}"

- name: Setup Cache
uses: Swatinem/rust-cache@v2

- name: Build Binary
run: cargo build --verbose --locked --release --target ${{ matrix.target }}

- name: Move Binary
shell: bash
run: |
BIN_SUFFIX=""
if [[ "${{ matrix.runner }}" == "windows-latest" ]]; then
BIN_SUFFIX=".exe"
fi
# The built binary output location
BIN_OUTPUT="target/${{ matrix.target }}/release/basiclings${BIN_SUFFIX}"

mkdir artifact
# Move the built binary where you want it
mv "${BIN_OUTPUT}" "./artifact/basiclings${BIN_SUFFIX}"
- name: Build Autotester
shell: bash
run: |
git clone https://github.com/CE-Programming/CEmu.git
cd CEmu/core
make
cd ../tests/autotester
make
cd ../../../
mv "CEmu/tests/autotester/autotester${BIN_SUFFIX}" "./artifact/autotester${BIN_SUFFIX}"
- name: Upload
uses: actions/[email protected]
with:
name: "basiclings-${{ matrix.name }}"
path: "artifact/"

0 comments on commit 4d7a793

Please sign in to comment.