-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
674 additions
and
43 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: check | ||
permissions: | ||
contents: read | ||
# This configuration allows maintainers of this repo to create a branch and pull request based on | ||
# the new branch. Restricting the push trigger to the main branch ensures that the PR only gets | ||
# built once. | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that | ||
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5 | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
jobs: | ||
fmt: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'chore: release')" | ||
name: stable / fmt | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install stable | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: rustfmt | ||
- name: cargo fmt --check | ||
run: cargo fmt --check | ||
clippy: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'chore: release')" | ||
name: ${{ matrix.toolchain }} / clippy | ||
permissions: | ||
contents: read | ||
checks: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Get early warning of new lints which are regularly introduced in beta channels. | ||
toolchain: [stable, beta] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install ${{ matrix.toolchain }} | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
components: clippy | ||
- name: cargo clippy | ||
uses: giraffate/clippy-action@v1 | ||
with: | ||
reporter: 'github-pr-check' | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
doc: | ||
runs-on: ubuntu-24.04 | ||
if: "!contains(github.event.head_commit.message, 'chore: release')" | ||
name: nightly / doc | ||
steps: | ||
- run: sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev | ||
- uses: actions/checkout@v4 | ||
- name: Install nightly | ||
uses: dtolnay/rust-toolchain@nightly | ||
- name: cargo doc | ||
run: cargo doc --no-deps --all-features | ||
env: | ||
RUSTDOCFLAGS: --cfg docsrs | ||
msrv: | ||
runs-on: ubuntu-24.04 | ||
if: "!contains(github.event.head_commit.message, 'chore: release')" | ||
strategy: | ||
matrix: | ||
msrv: ["1.74.0"] | ||
name: ubuntu / ${{ matrix.msrv }} | ||
steps: | ||
- run: sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev | ||
- uses: actions/checkout@v4 | ||
- name: Install ${{ matrix.msrv }} | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.msrv }} | ||
- name: cargo +${{ matrix.msrv }} check | ||
run: cargo check |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: prepare_release | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
github: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'chore: release')" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- uses: MarcoIeni/[email protected] | ||
with: | ||
command: release-pr | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: release | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
github: | ||
runs-on: ubuntu-24.04 | ||
if: "contains(github.event.head_commit.message, 'chore: release')" | ||
steps: | ||
- run: sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- uses: MarcoIeni/[email protected] | ||
with: | ||
command: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
|
||
linux: | ||
name: linux / ${{ matrix.target }} | ||
runs-on: ubuntu-latest | ||
needs: github | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
target: | ||
- aarch64-unknown-linux-gnu | ||
- aarch64-unknown-linux-musl | ||
- i686-unknown-linux-gnu | ||
- x86_64-unknown-linux-gnu | ||
- x86_64-unknown-linux-musl | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-tags: true | ||
|
||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --target ${{ matrix.target }} | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: goldboot-${{ matrix.target }} | ||
path: target/${{ matrix.target }}/release/turbine | ||
|
||
- name: Upload artifacts to release | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_REPO: ${{ github.repository }} | ||
run: | | ||
for tag in $(git tag --points-at HEAD); do | ||
if cp target/${{ matrix.target }}/release/${tag%-*} ${tag%-*}_${{ matrix.target }}; then | ||
gh release upload "${tag}" "${tag%-*}_${{ matrix.target }}" | ||
fi | ||
done | ||
docker: | ||
runs-on: ubuntu-latest | ||
needs: linux | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-tags: true | ||
|
||
- uses: docker/setup-qemu-action@v3 | ||
|
||
- uses: docker/setup-buildx-action@v3 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: turbine-x86_64-unknown-linux-musl | ||
path: turbine/linux-amd64 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: turbine-aarch64-unknown-linux-musl | ||
path: turbine/linux-arm64 | ||
|
||
- uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Find version tags | ||
id: get_tags | ||
run: | | ||
for tag in $(git tag --points-at HEAD); do | ||
echo "${tag%-*}=${tag##*-}" >>"$GITHUB_OUTPUT" | ||
done | ||
- uses: docker/build-push-action@v5 | ||
if: ${{ steps.get_tags.outputs.goldboot != '' }} | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 #,linux/arm/v7 | ||
push: true | ||
tags: fossable/turbine:latest,fossable/turbine:${{ steps.get_tags.outputs.turbine }} | ||
|
||
- uses: peter-evans/dockerhub-description@v4 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
repository: fossable/turbine | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: test | ||
permissions: | ||
contents: read | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
jobs: | ||
required: | ||
runs-on: ubuntu-24.04 | ||
if: "!contains(github.event.head_commit.message, 'chore: release')" | ||
name: ubuntu / ${{ matrix.toolchain }} | ||
strategy: | ||
matrix: | ||
# run on stable and beta to ensure that tests won't break on the next version of the rust | ||
# toolchain | ||
toolchain: [stable, beta] | ||
steps: | ||
- run: sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev | ||
- uses: actions/checkout@v4 | ||
- name: Install ${{ matrix.toolchain }} | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
- name: cargo generate-lockfile | ||
# enable this ci template to run regardless of whether the lockfile is checked in or not | ||
if: hashFiles('Cargo.lock') == '' | ||
run: cargo generate-lockfile | ||
# https://twitter.com/jonhoo/status/1571290371124260865 | ||
- name: cargo test --locked | ||
run: cargo test --locked --all-features | ||
# https://github.com/rust-lang/cargo/issues/6669 | ||
- name: cargo test --doc | ||
run: cargo test --locked --all-features --doc |
Oops, something went wrong.