Skip to content

Commit

Permalink
cleanup: format *.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
arxanas committed May 24, 2024
1 parent 690cbdc commit 03b8556
Show file tree
Hide file tree
Showing 8 changed files with 221 additions and 215 deletions.
44 changes: 22 additions & 22 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
commit-message:
prefix: "cargo:"
groups:
cargo-dependencies:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
commit-message:
prefix: "github:"
groups:
github-dependencies:
patterns:
- "*"
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
commit-message:
prefix: "cargo:"
groups:
cargo-dependencies:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
commit-message:
prefix: "github:"
groups:
github-dependencies:
patterns:
- "*"
86 changes: 43 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
os: [ubuntu-latest, macos-14, windows-latest]
cargo_flags: [""]
include:
- os: ubuntu-latest
cargo_flags: "--all-features"
- os: ubuntu-latest
cargo_flags: "--all-features"
runs-on: ${{ matrix.os }}

# TODO FIXME (aseipp): keep the timeout limit to ~15 minutes. this is long
Expand All @@ -37,44 +37,44 @@ jobs:
timeout-minutes: 15

steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29

# The default version of gpg installed on the runners is a version baked in with git
# which only contains the components needed by git and doesn't work for our test cases.
#
# This installs the latest gpg4win version, which is a variation of GnuPG built for
# Windows.
#
# There is some issue with windows PATH max length which is what all the PATH wrangling
# below is for. Please see the below link for where this fix was derived from:
# https://github.com/orgs/community/discussions/24933
- name: Setup GnuPG [windows]
if: ${{ matrix.os == 'windows-latest' }}
run: |
$env:PATH = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin"
[Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine")
choco install --yes gpg4win
echo "C:\Program Files (x86)\Gpg4win\..\GnuPG\bin" >> $env:GITHUB_PATH
# The default version of openssh on windows server is quite old (8.1) and doesn't have
# all the necessary signing/verification commands available (such as -Y find-principals)
- name: Setup ssh-agent [windows]
if: ${{ matrix.os == 'windows-latest' }}
run: |
Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
choco install openssh --pre
- name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: 1.76
- name: Build
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
- name: Test
run: cargo test --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
env:
RUST_BACKTRACE: 1
# The default version of gpg installed on the runners is a version baked in with git
# which only contains the components needed by git and doesn't work for our test cases.
#
# This installs the latest gpg4win version, which is a variation of GnuPG built for
# Windows.
#
# There is some issue with windows PATH max length which is what all the PATH wrangling
# below is for. Please see the below link for where this fix was derived from:
# https://github.com/orgs/community/discussions/24933
- name: Setup GnuPG [windows]
if: ${{ matrix.os == 'windows-latest' }}
run: |
$env:PATH = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin"
[Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine")
choco install --yes gpg4win
echo "C:\Program Files (x86)\Gpg4win\..\GnuPG\bin" >> $env:GITHUB_PATH
# The default version of openssh on windows server is quite old (8.1) and doesn't have
# all the necessary signing/verification commands available (such as -Y find-principals)
- name: Setup ssh-agent [windows]
if: ${{ matrix.os == 'windows-latest' }}
run: |
Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
choco install openssh --pre
- name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: 1.76
- name: Build
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
- name: Test
run: cargo test --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
env:
RUST_BACKTRACE: 1

check-protos:
name: Check protos
Expand Down Expand Up @@ -153,10 +153,10 @@ jobs:
continue-on-error: ${{ matrix.checks == 'advisories' }}

steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- uses: EmbarkStudios/cargo-deny-action@3f4a782664881cf5725d0ffd23969fcce89fd868
with:
command: check ${{ matrix.checks }}
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- uses: EmbarkStudios/cargo-deny-action@3f4a782664881cf5725d0ffd23969fcce89fd868
with:
command: check ${{ matrix.checks }}

clippy-check:
name: Clippy check
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ permissions: read-all

jobs:
dependabot-auto-merge:
name: 'Dependabot auto-merge'
name: "Dependabot auto-merge"
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- run: "git fetch origin gh-pages --depth=1"
- run: "git fetch origin gh-pages --depth=1"
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
with:
python-version: 3.11
Expand Down
139 changes: 73 additions & 66 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,74 +17,81 @@ jobs:
strategy:
fail-fast: false
matrix:
build: [linux-x86_64-musl, linux-aarch64-musl, macos-x86_64, macos-aarch64, win-msvc]
build:
[
linux-x86_64-musl,
linux-aarch64-musl,
macos-x86_64,
macos-aarch64,
win-msvc,
]
include:
- build: linux-x86_64-musl
os: ubuntu-24.04
target: x86_64-unknown-linux-musl
- build: linux-aarch64-musl
os: ubuntu-24.04
target: aarch64-unknown-linux-musl
- build: macos-x86_64
os: macos-11
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-14
target: aarch64-apple-darwin
- build: win-msvc
os: windows-2022
target: x86_64-pc-windows-msvc
- build: linux-x86_64-musl
os: ubuntu-24.04
target: x86_64-unknown-linux-musl
- build: linux-aarch64-musl
os: ubuntu-24.04
target: aarch64-unknown-linux-musl
- build: macos-x86_64
os: macos-11
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-14
target: aarch64-apple-darwin
- build: win-msvc
os: windows-2022
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool musl-tools
- name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Download cross-compilation tool (linux-aarch64)
if: matrix.target == 'aarch64-unknown-linux-musl'
run: wget -c https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-gnu.tar.gz -O - | tar -xz
- name: Build release binary
shell: bash
run: |
CARGO_CMD=cargo
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then
CARGO_CMD=$PWD/cross
fi
$CARGO_CMD build --target ${{ matrix.target }} --verbose --release --features packaging,vendored-openssl
- name: Build archive
shell: bash
run: |
outdir="target/${{ matrix.target }}/release"
staging="jj-${{ github.event.release.tag_name }}-${{ matrix.target }}"
mkdir "$staging"
cp {README.md,LICENSE} "$staging/"
if [ "${{ matrix.os }}" = "windows-2022" ]; then
cp "$outdir/jj.exe" "$staging/"
cd "$staging"
7z a "../$staging.zip" .
echo "ASSET=$staging.zip" >> $GITHUB_ENV
else
cp "$outdir/jj" "$staging/"
tar czf "$staging.tar.gz" -C "$staging" .
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload release archive
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream
- name: Checkout repository
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool musl-tools
- name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Download cross-compilation tool (linux-aarch64)
if: matrix.target == 'aarch64-unknown-linux-musl'
run: wget -c https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-gnu.tar.gz -O - | tar -xz
- name: Build release binary
shell: bash
run: |
CARGO_CMD=cargo
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-musl" ]; then
CARGO_CMD=$PWD/cross
fi
$CARGO_CMD build --target ${{ matrix.target }} --verbose --release --features packaging,vendored-openssl
- name: Build archive
shell: bash
run: |
outdir="target/${{ matrix.target }}/release"
staging="jj-${{ github.event.release.tag_name }}-${{ matrix.target }}"
mkdir "$staging"
cp {README.md,LICENSE} "$staging/"
if [ "${{ matrix.os }}" = "windows-2022" ]; then
cp "$outdir/jj.exe" "$staging/"
cd "$staging"
7z a "../$staging.zip" .
echo "ASSET=$staging.zip" >> $GITHUB_ENV
else
cp "$outdir/jj" "$staging/"
tar czf "$staging.tar.gz" -C "$staging" .
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi
- name: Upload release archive
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream

docs-release-archive:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -128,7 +135,7 @@ jobs:

steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- run: "git fetch origin gh-pages --depth=1"
- run: "git fetch origin gh-pages --depth=1"
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
with:
python-version: 3.11
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
- cron: '17 3 * * 1'
- cron: "17 3 * * 1"
push:
branches: [ main ]
branches: [main]

# Declare default permissions as read only.
permissions: read-all
Expand Down
18 changes: 9 additions & 9 deletions mkdocs-offline.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# This config is good if you plan to use the rendered docs from
# your file system. To use, run:
# poetry run -- mkdocs build -f mkdocs-offline.yml
INHERIT: 'mkdocs.yml'
INHERIT: "mkdocs.yml"
plugins:
- offline
- offline

# For now, *every plugin config* from `mkdocs.yml` has to be repeated here.
# https://github.com/mondeja/mkdocs-include-markdown-plugin/issues/195#issuecomment-1933085478
# https://github.com/mkdocs/mkdocs/issues/3216
- include-markdown # For the CLI reference
- search
- redirects:
redirect_maps:
# For now, *every plugin config* from `mkdocs.yml` has to be repeated here.
# https://github.com/mondeja/mkdocs-include-markdown-plugin/issues/195#issuecomment-1933085478
# https://github.com/mkdocs/mkdocs/issues/3216
- include-markdown # For the CLI reference
- search
- redirects:
redirect_maps:
# Turns out the `offline` plugin forces the following
# option no matter what, and therefore shouldn't be
# used in the main config file.
Expand Down
Loading

0 comments on commit 03b8556

Please sign in to comment.