;ci: add timestamp preservation to linux/mac/windows workflows too
This commit is contained in:
		
							parent
							
								
									2029a7d07d
								
							
						
					
					
						commit
						4c611f101c
					
				
							
								
								
									
										14
									
								
								.github/workflows/linux.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/linux.yml
									
									
									
									
										vendored
									
									
								
							@ -58,6 +58,20 @@ jobs:
 | 
			
		||||
 | 
			
		||||
    - name: Check out
 | 
			
		||||
      uses: actions/checkout@v2
 | 
			
		||||
      # deep clone so we can restore timestamps (see below)
 | 
			
		||||
      with:
 | 
			
		||||
        fetch-depth: 0
 | 
			
		||||
 | 
			
		||||
    # Restore timestamps to help stack not rebuild unchanged files.
 | 
			
		||||
    # https://stackoverflow.com/questions/60906336
 | 
			
		||||
    # https://stackoverflow.com/a/36243002/84401
 | 
			
		||||
    # https://www.reddit.com/r/haskell/comments/g00ldn/haskell_stack_on_github_actions/
 | 
			
		||||
    - name: Restore source file timestamps
 | 
			
		||||
      run: |
 | 
			
		||||
        git ls-tree -r --name-only HEAD | while read filename; do
 | 
			
		||||
          TS="$(git log -1 --format="%ct" -- ${filename})"
 | 
			
		||||
          touch "${filename}" -mt "$(date --date="@$TS" "+%Y%m%d%H%M.%S")"
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
    # things to be cached/restored:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								.github/workflows/mac.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/mac.yml
									
									
									
									
										vendored
									
									
								
							@ -30,6 +30,20 @@ jobs:
 | 
			
		||||
 | 
			
		||||
    - name: Check out
 | 
			
		||||
      uses: actions/checkout@v2
 | 
			
		||||
      # deep clone so we can restore timestamps (see below)
 | 
			
		||||
      with:
 | 
			
		||||
        fetch-depth: 0
 | 
			
		||||
 | 
			
		||||
    # Restore timestamps to help stack not rebuild unchanged files.
 | 
			
		||||
    # https://stackoverflow.com/questions/60906336
 | 
			
		||||
    # https://stackoverflow.com/a/36243002/84401
 | 
			
		||||
    # https://www.reddit.com/r/haskell/comments/g00ldn/haskell_stack_on_github_actions/
 | 
			
		||||
    - name: Restore source file timestamps
 | 
			
		||||
      run: |
 | 
			
		||||
        git ls-tree -r --name-only HEAD | while read filename; do
 | 
			
		||||
          TS="$(git log -1 --format="%ct" -- ${filename})"
 | 
			
		||||
          touch "${filename}" -mt "$(date --date="@$TS" "+%Y%m%d%H%M.%S")"
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
    # things to be cached/restored:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								.github/workflows/push.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/push.yml
									
									
									
									
										vendored
									
									
								
							@ -29,8 +29,7 @@ jobs:
 | 
			
		||||
 | 
			
		||||
    - name: Check out
 | 
			
		||||
      uses: actions/checkout@v2
 | 
			
		||||
      # Fetch all history, rather than a shallow clone, so that we
 | 
			
		||||
      # can restore timestamps (see below).
 | 
			
		||||
      # deep clone so we can restore timestamps (see below)
 | 
			
		||||
      with:
 | 
			
		||||
        fetch-depth: 0
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								.github/workflows/windows.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/workflows/windows.yml
									
									
									
									
										vendored
									
									
								
							@ -31,6 +31,20 @@ jobs:
 | 
			
		||||
 | 
			
		||||
    - name: Check out
 | 
			
		||||
      uses: actions/checkout@v2
 | 
			
		||||
      # deep clone so we can restore timestamps (see below)
 | 
			
		||||
      with:
 | 
			
		||||
        fetch-depth: 0
 | 
			
		||||
 | 
			
		||||
    # Restore timestamps to help stack not rebuild unchanged files.
 | 
			
		||||
    # https://stackoverflow.com/questions/60906336
 | 
			
		||||
    # https://stackoverflow.com/a/36243002/84401
 | 
			
		||||
    # https://www.reddit.com/r/haskell/comments/g00ldn/haskell_stack_on_github_actions/
 | 
			
		||||
    - name: Restore source file timestamps
 | 
			
		||||
      run: |
 | 
			
		||||
        git ls-tree -r --name-only HEAD | while read filename; do
 | 
			
		||||
          TS="$(git log -1 --format="%ct" -- ${filename})"
 | 
			
		||||
          touch "${filename}" -mt "$(date --date="@$TS" "+%Y%m%d%H%M.%S")"
 | 
			
		||||
        done
 | 
			
		||||
 | 
			
		||||
    # things to be cached/restored:
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user