diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c2f077..ee2eb23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,13 +3,13 @@ name: CI on: push jobs: - # format: - # name: Check Format - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v2 - # - name: Cargo fmt - # run: cargo fmt --all -- --check + format: + name: Check Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Cargo fmt + run: cargo fmt --all -- --check test: name: Test @@ -26,24 +26,24 @@ jobs: strategy: fail-fast: false matrix: - build: [linux-arm] + build: [linux, linux-arm, macos, macos-arm] include: - # - build: linux - # os: ubuntu-latest - # rust: stable - # target: x86_64-unknown-linux-gnu + - build: linux + os: ubuntu-latest + rust: stable + target: x86_64-unknown-linux-gnu - build: linux-arm os: ubuntu-latest rust: stable target: aarch64-unknown-linux-gnu - # - build: macos - # os: macos-latest - # rust: stable - # target: x86_64-apple-darwin - # - build: macos-arm - # os: ubuntu-20.04 - # rust: stable - # target: aarch64-apple-darwin + - build: macos + os: macos-latest + rust: stable + target: x86_64-apple-darwin + - build: macos-arm + os: ubuntu-20.04 + rust: stable + target: aarch64-apple-darwin # - build: windows # os: windows-latest # rust: stable @@ -57,35 +57,35 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - # - name: Install Rust - # uses: actions-rs/toolchain@v1 - # with: - # toolchain: ${{ matrix.rust }} - # profile: minimal - # override: true - # target: ${{ matrix.target }} + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + profile: minimal + override: true + target: ${{ matrix.target }} - # - name: Login to GitHub Container Registry - # if: matrix.build == 'macos-arm' || matrix.build == 'windows-arm' - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GH_REGISTRY_TOKEN }} + - name: Login to GitHub Container Registry + if: matrix.build == 'macos-arm' || matrix.build == 'windows-arm' + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GH_REGISTRY_TOKEN }} - # - name: Use Cross - # shell: bash - # run: | - # cargo install cross - # echo "CARGO=cross" >> $GITHUB_ENV - # echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV - # echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV + - name: Use Cross + shell: bash + run: | + cargo install cross + echo "CARGO=cross" >> $GITHUB_ENV + echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV + echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV - # - name: Show command used for Cargo - # run: | - # echo "cargo command is: ${{ env.CARGO }}" - # echo "target flag is: ${{ env.TARGET_FLAGS }}" - # echo "target dir is: ${{ env.TARGET_DIR }}" + - name: Show command used for Cargo + run: | + echo "cargo command is: ${{ env.CARGO }}" + echo "target flag is: ${{ env.TARGET_FLAGS }}" + echo "target dir is: ${{ env.TARGET_DIR }}" # - name: Install Linux ARM toolchain # if: matrix.build == 'linux-arm' @@ -128,15 +128,15 @@ jobs: # sudo apt install libgcc-s1:arm64 gcc g++ libc6-dev libclang-dev pkg-config libstd-rust-dev:arm64 gcc-aarch64-linux-gnu qemu-user -y # rustup target add aarch64-unknown-linux-gnu - # - name: Build - # run: ${{ env.CARGO }} build --verbose ${{ env.TARGET_FLAGS }} + - name: Build + run: ${{ env.CARGO }} build --verbose ${{ env.TARGET_FLAGS }} - # - name: Run tests - # if: matrix.build != 'macos-arm' - # shell: bash - # run: | - # if [[ "${{ matrix.build }}" = "linux" || "${{ matrix.build }}" = "linux-arm" ]]; then - # cargo test ${{ env.TARGET_FLAGS }} -- --nocapture - # else - # ${{ env.CARGO }} test ${{ env.TARGET_FLAGS }} -- --nocapture - # fi + - name: Run tests + if: matrix.build != 'macos-arm' + shell: bash + run: | + if [[ "${{ matrix.build }}" = "linux" || "${{ matrix.build }}" = "linux-arm" ]]; then + cargo test ${{ env.TARGET_FLAGS }} -- --nocapture + else + ${{ env.CARGO }} test ${{ env.TARGET_FLAGS }} -- --nocapture + fi diff --git a/.github/workflows/release.yml.bak b/.github/workflows/release.yml similarity index 100% rename from .github/workflows/release.yml.bak rename to .github/workflows/release.yml