Skip to content

Commit

Permalink
Initial code import
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Aug 13, 2021
1 parent 9d73d96 commit 5d28c6a
Show file tree
Hide file tree
Showing 11 changed files with 1,383 additions and 8 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Rust

on:
push:
branches: [main]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
checks:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest

toolchain:
- 1.54.0
- stable
- nightly

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
profile: minimal
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
with:
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ matrix.toolchain }}
- name: Build
run: cargo build
- name: Run tests
run: cargo test
- name: clippy
run: cargo clippy -- --deny "warnings"
- name: fmt
run: cargo fmt -- --check

linux-binary:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.54.0
target: x86_64-unknown-linux-musl
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.54.0-binary
- name: Install musl tools
run: sudo apt-get install -y musl-tools
- name: Build
run: cargo build --release --target x86_64-unknown-linux-musl
- uses: actions/upload-artifact@v2
with:
name: linux
path: target/x86_64-unknown-linux-musl/release/amber

macos-binary:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.54.0
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.54.0-binary
- name: Build
run: cargo build --release
- uses: actions/upload-artifact@v2
with:
name: macos
path: target/release/amber

windows-binary:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.54.0
profile: minimal
override: true
- uses: Swatinem/rust-cache@v1
with:
key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-1.54.0-binary
- name: Build
run: cargo build --release
- uses: actions/upload-artifact@v2
with:
name: windows
path: target/release/amber.exe
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
# Generated by Cargo
# will have compiled files and executables
/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk
Loading

0 comments on commit 5d28c6a

Please sign in to comment.