ci: install Rust and other dependencies within the main job script #127
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 | |
- extract-changelog | |
- rustfmt | |
- clippy | |
- build-and-test | |
- package-crates | |
- build-dist-linux | |
- build-dist-windows | |
# 'always()' is needed because GitHub treats a skipped job (due to a failed | |
# dependency) a success. | |
if: always() | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Report status | |
env: | |
NEEDS_JSON: ${{ toJson(needs) }} | |
# Make sure all dependencies succeeded. | |
run: jq --exit-status 'all(.result == "success")' <<< "$NEEDS_JSON" | |
lint-aux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run job | |
run: ./ci/lint-aux.sh | |
extract-changelog: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run job | |
run: ./ci/extract-changelog.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: version-changelog | |
path: version-changelog | |
if-no-files-found: error | |
rustfmt: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run job | |
run: ./ci/rustfmt.sh | |
clippy: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run job | |
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: Run job | |
run: ./ci/build-and-test.sh "${{ matrix.rust-version }}" | |
package-crates: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run job | |
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 | |
env: | |
IMAGE_NAME: quay.io/pypa/manylinux2014_x86_64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull image | |
run: docker pull "$IMAGE_NAME" | |
- name: Build | |
run: | | |
docker run \ | |
-v "$(pwd):/workdir" \ | |
-w /workdir \ | |
"$IMAGE_NAME" \ | |
bash ./ci/build-dist-linux.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-linux | |
path: | | |
output/rsjsonnet-linux-x86_64.tar.gz | |
output/rsjsonnet-linux-i686.tar.gz | |
if-no-files-found: error | |
build-dist-windows: | |
runs-on: ubuntu-20.04 | |
env: | |
IMAGE_NAME: debian:12-slim | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull image | |
run: docker pull "$IMAGE_NAME" | |
- name: Build | |
run: | | |
docker run \ | |
-v "$(pwd):/workdir" \ | |
-w /workdir \ | |
"$IMAGE_NAME" \ | |
bash ./ci/build-dist-windows.sh | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-windows | |
path: | | |
output/rsjsonnet-windows-x86_64.zip | |
output/rsjsonnet-windows-i686.zip | |
if-no-files-found: error |