diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..7b7d026 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,97 @@ +name: CI + +on: + pull_request: + release: + types: + - released + - prereleased + +jobs: + macos: + runs-on: macos-latest + strategy: + matrix: + python-version: ['3.9'] + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-apple-darwin + - name: Build + run: cargo build --release + - name: Tests + run: cargo test --no-default-features --release + + windows: + runs-on: windows-latest + strategy: + matrix: + python-version: ['3.9'] + target: [x64] + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.target }} + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Build + if: matrix.target == 'x64' + run: cargo build --release + - name: Tests + if: matrix.target == 'x64' + run: cargo test --no-default-features --release + + linux: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.9'] + target: [x86_64] + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Build + run: cargo build --release + - name: Tests + run: cargo test --no-default-features --release