git-branchless 0.3.4

Branchless workflow for Git
Documentation
name: Linux

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  build-git:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        # Use a tag from https://github.com/git/git/tags
        git-version: ["v2.24.3", "v2.29.2", "v2.31.1"]
    steps:
      - uses: actions/checkout@v2
        with:
          repository: git/git
          ref: ${{ matrix.git-version }}
      - uses: actions/cache@v2
        id: cache-git-build
        with:
          key: ${{ runner.os }}-git-${{ matrix.git-version }}
          path: git
      - name: Build Git ${{ matrix.git-version }}
        if: steps.cache-git-build.outputs.cache-hit != 'true'
        run: |
          sudo apt-get update --fix-missing
          # List of dependencies from https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
          sudo apt-get install dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev
          make
      - name: Package Git
        run: tar -czf git.tar.gz git
      - name: "Upload artifact: git"
        uses: actions/upload-artifact@v2
        with:
          name: git-${{ matrix.git-version }}
          path: git.tar.gz
          if-no-files-found: error

  run-tests:
    runs-on: ubuntu-latest
    needs: build-git
    strategy:
      matrix:
        git-version: ["v2.24.3", "v2.29.2", "v2.31.1"]
    steps:
      - uses: actions/checkout@v2
      - name: "Download artifact: git"
        uses: actions/download-artifact@v2
        with:
          name: git-${{ matrix.git-version }}
      - name: "Unpack artifact: git"
        run: tar -xf git.tar.gz
      - name: Set up Rust
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
      - name: Run Rust tests
        run: |
          export RUST_BACKTRACE=1
          export PATH_TO_GIT="$PWD"/git
          cargo test