From 6140e73a7ea5e635f0c616c87bd8d78ce3305553 Mon Sep 17 00:00:00 2001 From: Robert Michalak Date: Tue, 6 Dec 2022 13:48:24 +0000 Subject: [PATCH 1/5] add builds for different platforms and smoke tests in CI --- .github/workflows/build.yml | 63 +++++++++++++++++++++++++++++++++-- .github/workflows/release.yml | 12 +++---- 2 files changed, 66 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3cb323f..9cdb489 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: jobs: check: - name: Format, Clippy, Build + name: Format, Clippy runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 @@ -37,11 +37,68 @@ jobs: with: command: clippy args: -- -D warnings + + build-linux: + name: Build Linux + runs-on: ubuntu-22.04 + steps: + - name: Install dev tools + run: | + sudo apt update + sudo apt -y install musl-tools libssl-dev + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + target: x86_64-unknown-linux-musl + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release --target x86_64-unknown-linux-musl + - name: Smoke test + run: target/x86_64-unknown-linux-musl/release/pg_parcel --help + + + build-aarch64-apple-darwin: + name: Build macOS ARM + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + target: aarch64-apple-darwin + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: build + args: --release --target aarch64-apple-darwin + - name: Smoke test + run: arch -arm64e target/aarch64-apple-darwin/release/pg_parcel --help + + build-x86_64-apple-darwin: + name: Build macOS Intel + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + target: x86_64-apple-darwin + - uses: Swatinem/rust-cache@v1 - uses: actions-rs/cargo@v1 - name: build --no-default-features with: command: build - args: --target x86_64-unknown-linux-musl --no-default-features + args: --release --target x86_64-apple-darwin + - name: Smoke test + run: target/x86_64-apple-darwin/release/pg_parcel --help test: name: Test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 68cf58f..4ef674c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: - "v*" jobs: - aarch64-apple-darwin: + aarch64-apple-darwin-release: name: Build macOS ARM runs-on: macos-latest steps: @@ -28,7 +28,7 @@ jobs: path: target/aarch64-apple-darwin/release/pg_parcel if-no-files-found: error - x86_64-apple-darwin: + x86_64-apple-darwin-release: name: Build macOS Intel runs-on: macos-latest steps: @@ -50,10 +50,10 @@ jobs: path: target/x86_64-apple-darwin/release/pg_parcel if-no-files-found: error - macos-universal: + macos-universal-release: name: Build macOS Universal runs-on: macos-latest - needs: [aarch64-apple-darwin, x86_64-apple-darwin] + needs: [aarch64-apple-darwin-release, x86_64-apple-darwin-release] steps: - uses: actions/download-artifact@v2 with: @@ -77,7 +77,7 @@ jobs: path: pg_parcel-apple-darwin if-no-files-found: error - build-linux: + build-linux-release: name: Build Linux runs-on: ubuntu-22.04 steps: @@ -105,7 +105,7 @@ jobs: create-release: name: Create release - needs: [macos-universal, build-linux] + needs: [macos-universal-release, build-linux-release] runs-on: ubuntu-22.04 steps: - uses: actions/download-artifact@v2 From 080d3e9e14445d06dfcf0ef1a6e57e94d40dfc13 Mon Sep 17 00:00:00 2001 From: Robert Michalak Date: Wed, 7 Dec 2022 13:48:34 +0000 Subject: [PATCH 2/5] reorganize CI jobs --- .github/workflows/build.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9cdb489..eeb97a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,6 +41,7 @@ jobs: build-linux: name: Build Linux runs-on: ubuntu-22.04 + needs: [ check ] steps: - name: Install dev tools run: | @@ -65,6 +66,7 @@ jobs: build-aarch64-apple-darwin: name: Build macOS ARM runs-on: macos-latest + needs: [ check ] steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -78,12 +80,14 @@ jobs: with: command: build args: --release --target aarch64-apple-darwin - - name: Smoke test - run: arch -arm64e target/aarch64-apple-darwin/release/pg_parcel --help + # There's no ARM64 macos available in github actions. + # - name: Smoke test + # run: arch -arm64e target/aarch64-apple-darwin/release/pg_parcel --help build-x86_64-apple-darwin: name: Build macOS Intel runs-on: macos-latest + needs: [ check ] steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -103,11 +107,8 @@ jobs: test: name: Test runs-on: ubuntu-22.04 + needs: [ check ] steps: - - name: Install dev tools - run: | - sudo apt update - sudo apt -y install musl-tools libssl-dev - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: From 4774f78ced40312944972d27e0922835b49a50a7 Mon Sep 17 00:00:00 2001 From: Robert Michalak Date: Wed, 7 Dec 2022 13:58:49 +0000 Subject: [PATCH 3/5] add smoke tests to release flows --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ef674c..d77a46d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,6 +44,8 @@ jobs: with: command: build args: --release --target x86_64-apple-darwin + - name: Smoke test + run: target/x86_64-apple-darwin/release/pg_parcel --help - uses: actions/upload-artifact@v2 with: name: x86_64-apple-darwin @@ -71,6 +73,8 @@ jobs: -output pg_parcel-apple-darwin \ pg_parcel-x86_64-apple-darwin/pg_parcel \ pg_parcel-aarch64-apple-darwin/pg_parcel + - name: Smoke test + run: pg_parcel-apple-darwin --help - uses: actions/upload-artifact@v2 with: name: apple-darwin @@ -97,6 +101,8 @@ jobs: with: command: build args: --release --target x86_64-unknown-linux-musl + - name: Smoke test + run: target/x86_64-unknown-linux-musl/release/pg_parcel --help - uses: actions/upload-artifact@v2 with: name: linux From bde6d14ec4fb62590e90fd0752368a14c4f351d9 Mon Sep 17 00:00:00 2001 From: Robert Michalak Date: Wed, 7 Dec 2022 14:38:31 +0000 Subject: [PATCH 4/5] bump Swatinem/rust-cache action version --- .github/workflows/build.yml | 6 +++--- .github/workflows/release.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eeb97a8..91c7efa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,7 +54,7 @@ jobs: toolchain: stable override: true target: x86_64-unknown-linux-musl - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: build @@ -75,7 +75,7 @@ jobs: toolchain: stable override: true target: aarch64-apple-darwin - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: build @@ -96,7 +96,7 @@ jobs: toolchain: stable override: true target: x86_64-apple-darwin - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d77a46d..4aa6078 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: toolchain: stable override: true target: aarch64-apple-darwin - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: build @@ -39,7 +39,7 @@ jobs: toolchain: stable override: true target: x86_64-apple-darwin - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: build @@ -96,7 +96,7 @@ jobs: toolchain: stable override: true target: x86_64-unknown-linux-musl - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: build From 64a89a0575254aba665ff066e3b927f279aab961 Mon Sep 17 00:00:00 2001 From: Robert Michalak Date: Wed, 7 Dec 2022 14:47:15 +0000 Subject: [PATCH 5/5] update checkout action to get rid node-12 deprecation warning --- .github/workflows/build.yml | 10 +++++----- .github/workflows/release.yml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 91c7efa..1775162 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: name: Format, Clippy runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install dev tools run: | sudo apt update @@ -47,7 +47,7 @@ jobs: run: | sudo apt update sudo apt -y install musl-tools libssl-dev - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -68,7 +68,7 @@ jobs: runs-on: macos-latest needs: [ check ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -89,7 +89,7 @@ jobs: runs-on: macos-latest needs: [ check ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -109,7 +109,7 @@ jobs: runs-on: ubuntu-22.04 needs: [ check ] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4aa6078..f39aac6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: name: Build macOS ARM runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -32,7 +32,7 @@ jobs: name: Build macOS Intel runs-on: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -89,7 +89,7 @@ jobs: run: | sudo apt update sudo apt -y install musl-tools libssl-dev - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: profile: minimal