Skip to content

Fix CI cache restore #412

Fix CI cache restore

Fix CI cache restore #412

Workflow file for this run

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: record files
run: |
find / -xdev -path /nix/store -prune -o -not -path ~/files-before-nix-installation -not -path ~/files-after-nix-installation -print | sort > ~/files-before-nix-installation
- name: Install Nix with cached packages
uses: ibbem/cache-install@a47c89d4fbfdf64902ff75991fb1d37de96917f7
with:
key: nix-${{ hashFiles('.github/workflows/maven.yml', 'default.nix', 'nix/**', 'pom.xml', 'local-maven-repo') }}
nix_file: nix/github-workflow-dependencies.nix
- name: record files
run: |
find / -xdev -path /nix/store -prune -o -not -path ~/files-before-nix-installation -not -path ~/files-after-nix-installation -print | sort > ~/files-after-nix-installation
echo
echo "--------------------------------------- removed files ---------------------------------------"
comm -23 ~/files-before-nix-installation ~/files-after-nix-installation
echo
echo "--------------------------------------- added files ---------------------------------------"
comm -13 ~/files-before-nix-installation ~/files-after-nix-installation
echo "------------------------------------------------------------------------------"
- name: show new files
run: |
print() {
echo "------------------- start of $1 -------------------"
cat "$1" || true
echo "--------------------- end of $1 -------------------"
}
print /etc/bash.bashrc.backup-before-nix
print /etc/bashrc
print /etc/nix/nix.conf
print /etc/profile.d/nix.sh
print /etc/zshrc
print /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
echo "NIX_PATH=$NIX_PATH"
ls -ld "$NIX_PATH" || true
ls -l "$NIX_PATH" || true
echo nix-info:
nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/6832d0d99649db3d65a0e15fa51471537b2c56a6.tar.gz -p nix-info --run 'nix-info --markdown'
- name: Build
run: nix-build
- name: Upload Javadoc artifact
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
uses: actions/upload-pages-artifact@v3
with:
path: result/share/github-pages/DiffDetective
# An additional job is recommened in the documentation of `actions/deploy-pages`
deploy-javadoc:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
needs: build
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- name: Publish Javadoc to Github Pages
id: deployment
uses: actions/deploy-pages@v4
# Kill in progress deployments because only the newest version is relevant
# and concurrent deployments cause CI failures.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true