ci: add distribution builds for Windows #54
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
report: | ||
needs: | ||
- lint-aux | ||
- rustfmt | ||
- clippy | ||
- build-and-test | ||
- package-crates | ||
- build-dist-linux | ||
if: always() | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Report success | ||
if: "!contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')" | ||
run: exit 0 | ||
- name: Report failure | ||
if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')" | ||
run: exit 1 | ||
lint-aux: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: ./ci/install-lint-deps.sh | ||
- name: Run auxilary lints | ||
run: ./ci/lint-aux.sh | ||
rustfmt: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: ./ci/install-rust.sh stable.txt --profile minimal -c rustfmt | ||
- name: Run rustfmt | ||
run: cargo fmt --all -- --check | ||
clippy: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: ./ci/install-rust.sh stable.txt --profile minimal -c clippy | ||
- name: Run clippy | ||
run: ./ci/clippy.sh | ||
build-and-test: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- rust-version: msrv.txt | ||
- rust-version: stable.txt | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: ./ci/install-rust.sh "${{ matrix.rust-version }}" --profile minimal | ||
- name: Build and test | ||
run: ./ci/build-and-test.sh | ||
package-crates: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
run: ./ci/install-rust.sh stable.txt --profile minimal | ||
- name: Package crates | ||
run: ./ci/package-crates.sh | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: packaged-crates | ||
path: output | ||
if-no-files-found: error | ||
build-dist-linux: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Pull image | ||
run: docker pull quay.io/pypa/manylinux2014_x86_64 | ||
- name: Build | ||
run: | | ||
docker run \ | ||
-v "$(pwd):/workdir" \ | ||
-w /workdir \ | ||
quay.io/pypa/manylinux2014_x86_64 \ | ||
bash ./ci/build-dist-linux.sh | ||
- name: Upload linux-x86_64 artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-linux-x86_64 | ||
path: output/rsjsonnet-linux-x86_64 | ||
if-no-files-found: error | ||
- name: Upload linux-i686 artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-linux-i686 | ||
path: output/rsjsonnet-linux-i686 | ||
if-no-files-found: error | ||
build-dist-linux: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Pull image | ||
run: docker pull debian:buster | ||
- name: Build | ||
run: | | ||
docker run \ | ||
-v "$(pwd):/workdir" \ | ||
-w /workdir \ | ||
debian:buster \ | ||
bash ./ci/build-dist-windows.sh | ||
- name: Upload windows-x86_64 artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-windows-x86_64 | ||
path: output/rsjsonnet-windows-x86_64 | ||
if-no-files-found: error | ||
- name: Upload windows-i686 artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-windows-i686 | ||
path: output/rsjsonnet-windows-i686 | ||
if-no-files-found: error |