Skip to content

Commit

Permalink
Merge branch 'main' into index-from-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 1, 2022
2 parents adf5e54 + 2571831 commit bc64b96
Show file tree
Hide file tree
Showing 331 changed files with 11,004 additions and 3,629 deletions.
9 changes: 3 additions & 6 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
----

Can [Byron](https://github.com/Byron) review the PR on video?
Ok for [Byron](https://github.com/Byron) review the PR on video?

Please choose one - no choice means no recordings are made.
- [ ] I give my permission to record review and upload on YouTube publicly

- [ ] Record review and upload on YouTube publicly
- [ ] Record review and upload on YouTube, but keep video unlisted

If you ticked any of the above boxes, I will always share a link to the video in the PR.
If I think the review will be helpful for the community, then I might record and publish a video.
71 changes: 42 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: ci
on:
push:
branches: [ main ]
tags-ignore: '*'
tags-ignore: [ '*' ]
paths:
- '.github/**'
- 'ci/**'
Expand Down Expand Up @@ -33,8 +33,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: Setup dependencies
run:
sudo apt-get install tree
Expand All @@ -51,52 +51,65 @@ jobs:
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- run: rustup set auto-self-update disable
if: contains(runner.os, 'windows')
shell: bash
- uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Setup dependencies (macos)
if: startsWith(matrix.os, 'macos')
run:
brew install tree openssl gnu-sed
- name: "cargo check default features"
if: startsWith(matrix.os, 'windows')
uses: actions-rs/cargo@v1
with:
command: check
args: --all --bins --examples
run: cargo check --all --bins --examples
- run: git lfs fetch && git lfs checkout
- uses: taiki-e/install-action@v1
with:
tool: nextest
version: 0.9
- name: "Test (nextest)"
run: cargo nextest run --all --no-fail-fast

installation:
strategy:
matrix:
build: [ win-msvc, win-gnu, win32-msvc ]
include:
- build: win-msvc
os: windows-2019
rust: stable
target: x86_64-pc-windows-msvc
- build: win-gnu
os: windows-2019
rust: nightly-x86_64-gnu
target: x86_64-pc-windows-gnu
- build: win32-msvc
os: windows-2019
rust: nightly
target: i686-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: "Install prerequisites"
run: vcpkg install zlib:x64-windows-static-md
if: startsWith(matrix.os, 'windows')
- name: "Installation from crates.io"
if: startsWith(matrix.os, 'windows')
uses: actions-rs/cargo@v1
with:
command: install
args: "--force gitoxide cargo-smart-release"
- name: "Installation from crates.io: gitoxide"
run: cargo install --target ${{ matrix.target }} --target-dir install-artifacts --debug --force gitoxide
- name: "Installation from crates.io: cargo-smart-release"
run: cargo install --target ${{ matrix.target }} --target-dir install-artifacts --debug --force cargo-smart-release

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
profile: default
toolchain: stable
override: true
components: clippy,rustfmt
- name: Run cargo clippy
run: cargo clippy --all --tests
- name: Run cargo fmt
Expand All @@ -122,7 +135,7 @@ jobs:
continue-on-error: ${{ matrix.checks == 'advisories' }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}
4 changes: 2 additions & 2 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
stress:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
- name: stress
run: make stress
23 changes: 7 additions & 16 deletions .github/workflows/msrv.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: Minimum Supported Rust Version

on:
# Trigger the workflow on push to master or any pull request
# Ignore all tags
push:
branches:
- main
tags-ignore: '*'
branches: [ main ]
tags-ignore: [ '*' ]
pull_request:
branches:
- 'main'

name: Minimum Supported Rust Version
branches: [ main ]

jobs:
rustfmt:
Expand All @@ -21,15 +19,8 @@ jobs:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- run: rustup set auto-self-update disable
if: contains(runner.os, 'windows')
shell: bash
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: "1.59.0" # dictated by `windows` crates effectively, IMPORTANT: adjust etc/msrv-badge.svg as well
override: true
- uses: actions/checkout@v3
- uses: dtolnay/[email protected] # dictated by `windows` crates effectively, IMPORTANT: adjust etc/msrv-badge.svg as well
- run: make check-msrv-on-ci
continue-on-error: true # TODO: turn this off once the toolchain gets updated. There is a strange error preventing cargo to select the correct libgit2 version
# like it doesn't exist.
36 changes: 14 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
# The key here is that we create the release only once.

name: release

on:
push:
# Enable when testing release infrastructure on a branch.
# branches:
# - ag/release
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
# branches: [ 'ag/release' ]
tags: [ "v[0-9]+.[0-9]+.[0-9]+" ]
jobs:
create-release:
name: create-release
Expand Down Expand Up @@ -53,21 +52,21 @@ jobs:
run: echo "${{ env.ARTIFACT_VERSION }}" > artifacts/release-version

- name: Upload artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v3
with:
name: artifacts
path: artifacts

build-release:
name: build-release
needs: ["create-release"]
needs: [ "create-release" ]
runs-on: ${{ matrix.os }}
env:
# For some builds, we use cross to test on 32-bit and big-endian
# systems.
CARGO: cargo
# When CARGO is set to CROSS, this is set to `--target matrix.target`.
TARGET_FLAGS:
TARGET_FLAGS: ""
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target.
TARGET_DIR: ./target
# Emit backtraces on panics.
Expand All @@ -76,9 +75,9 @@ jobs:
EXE_NAME: ein
strategy:
matrix:
# build: [linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc]
build: [linux, macos, win-msvc, win-gnu, win32-msvc]
feature: ["small", "lean", "max"]
# build: [ linux, linux-arm, macos, win-msvc, win-gnu, win32-msvc ]
build: [ linux, macos, win-msvc, win-gnu, win32-msvc ]
feature: [ "small", "lean", "max" ]
include:
- build: linux
os: ubuntu-18.04
Expand Down Expand Up @@ -107,7 +106,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 1

Expand All @@ -121,17 +120,11 @@ jobs:
run: |
ci/macos-install-packages
- run: rustup set auto-self-update disable
if: contains(runner.os, 'windows')
shell: bash

- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
target: ${{ matrix.target }}
targets: ${{ matrix.target }}

- name: Use Cross
# if: matrix.os != 'windows-2019'
Expand All @@ -148,7 +141,7 @@ jobs:
echo "target dir is: ${{ env.TARGET_DIR }}"
- name: Get release download URL
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: artifacts
path: artifacts
Expand Down Expand Up @@ -182,13 +175,12 @@ jobs:
- name: Build archive
shell: bash
run: |
staging="${{ env.EXE_NAME }}-${{ matrix.feature }}-${{ env.RELEASE_VERSION }}-${{ matrix.target }}"
staging="gitoxide-${{ matrix.feature }}-${{ env.RELEASE_VERSION }}-${{ matrix.target }}"
mkdir -p "$staging"
cp {README.md,LICENSE-*,CHANGELOG.md} "$staging/"
if [ "${{ matrix.os }}" = "windows-2019" ]; then
# cp target/${{ matrix.target }}/release/${{ env.EXE_NAME }}.exe "$staging/"
cp target/release/${{ env.EXE_NAME }}.exe target/release/gix.exe "$staging/"
7z a "$staging.zip" "$staging"
echo "ASSET=$staging.zip" >> $GITHUB_ENV
Expand Down
Loading

0 comments on commit bc64b96

Please sign in to comment.