env:
  CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
  CI_ALLOW_ROOT: '1'
  CI_CONFIG: ./ci/niv-cron.nix
  CI_PLATFORM: gh-actions
  OPENSSH_PRIVATE_KEY: ${{ secrets.OPENSSH_PRIVATE_KEY }}
jobs:
  ci-check:
    name: niv-update check
    runs-on: ubuntu-latest
    steps:
    - id: checkout
      name: git clone
      uses: actions/checkout@v1
      with:
        submodules: false
    - id: nix-install
      name: nix install
      uses: arcnmx/ci/actions/nix/install@master
    - id: ci-action-build
      name: nix build ci.gh-actions.configFile
      uses: arcnmx/ci/actions/nix/build@master
      with:
        attrs: ci.gh-actions.configFile
        out-link: .ci/workflow.yml
    - id: ci-action-compare
      name: gh-actions compare
      uses: arcnmx/ci/actions/nix/run@master
      with:
        args: -u .github/workflows/niv-update.yml .ci/workflow.yml
        attrs: nixpkgs.diffutils
        command: diff
  niv-update:
    name: niv-update
    runs-on: ubuntu-latest
    steps:
    - id: checkout
      name: git clone
      uses: actions/checkout@v1
      with:
        submodules: false
    - id: nix-install
      name: nix install
      uses: arcnmx/ci/actions/nix/install@master
    - id: ci-setup
      name: nix setup
      uses: arcnmx/ci/actions/nix/run@master
      with:
        attrs: ci.job.niv-update.run.bootstrap
        quiet: false
    - id: ci-dirty
      name: nix test dirty
      uses: arcnmx/ci/actions/nix/run@master
      with:
        attrs: ci.job.niv-update.run.test
        command: ci-build-dirty
        quiet: false
        stdout: ${{ runner.temp }}/ci.build.dirty
    - id: ci-test
      name: nix test build
      uses: arcnmx/ci/actions/nix/run@master
      with:
        attrs: ci.job.niv-update.run.test
        command: ci-build-realise
        ignore-exit-code: true
        quiet: false
        stdin: ${{ runner.temp }}/ci.build.dirty
    - env:
        CI_EXIT_CODE: ${{ steps.ci-test.outputs.exit-code }}
      id: ci-summary
      name: nix test results
      uses: arcnmx/ci/actions/nix/run@master
      with:
        attrs: ci.job.niv-update.run.test
        command: ci-build-summarise
        quiet: false
        stdin: ${{ runner.temp }}/ci.build.dirty
        stdout: ${{ runner.temp }}/ci.build.cache
    - env:
        CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
      id: ci-cache
      if: always()
      name: nix test cache
      uses: arcnmx/ci/actions/nix/run@master
      with:
        attrs: ci.job.niv-update.run.test
        command: ci-build-cache
        quiet: false
        stdin: ${{ runner.temp }}/ci.build.cache
name: niv-update
'on':
  pull_request:
    paths:
    - default.nix
    - ci/niv-cron.nix
    - .github/workflows/niv-update.yml
  push:
    paths:
    - default.nix
    - ci/niv-cron.nix
    - .github/workflows/niv-update.yml
  schedule:
  - cron: 0 */6 * * *
