2022-01-17 11:18:00 +00:00
|
|
|
name: "Nixpkgs: Hourly import to Elasticsearch"
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
|
|
- cron: '0 * * * *'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
import-nixpkgs:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
2022-01-24 17:47:19 +00:00
|
|
|
fail-fast: false
|
2022-01-17 11:18:00 +00:00
|
|
|
matrix:
|
|
|
|
channel:
|
|
|
|
- unstable
|
|
|
|
- 21.11
|
|
|
|
- 21.05
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_LOG: debug
|
|
|
|
FI_ES_EXISTS_STRATEGY: abort
|
|
|
|
FI_ES_URL: ${{ secrets.ELASTICSEARCH_URL }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checking out the repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Installing Nix
|
|
|
|
uses: cachix/install-nix-action@v16
|
|
|
|
with:
|
|
|
|
nix_path: nixpkgs=channel:nixpkgs-unstable
|
|
|
|
|
|
|
|
- uses: cachix/cachix-action@v10
|
|
|
|
with:
|
|
|
|
name: nixos-search
|
|
|
|
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
|
|
|
|
|
|
|
- name: Installing jq
|
|
|
|
run: |
|
|
|
|
nix-env -f '<nixpkgs>' -iA jq
|
|
|
|
|
|
|
|
- name: Building flake-info
|
|
|
|
run: |
|
|
|
|
nix -vL build .#flake-info
|
|
|
|
|
|
|
|
- name: Import ${{ matrix.channel }} channel
|
2022-02-05 14:24:16 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-01-17 11:18:00 +00:00
|
|
|
run: |
|
|
|
|
./result/bin/flake-info --push --elastic-schema-version=$(< VERSION) nixpkgs ${{ matrix.channel }}
|
|
|
|
if: github.repository_owner == 'NixOS'
|
|
|
|
|
|
|
|
- name: Warmup ${{ matrix.channel }} channel
|
|
|
|
run: |
|
|
|
|
for (( i = 0; i < 3; i++ )) do
|
|
|
|
curl -sS ${{ secrets.ELASTICSEARCH_URL }}/latest-$(< VERSION)-nixos-${{ matrix.channel }}/_search | jq -c '.took // .'
|
|
|
|
done
|
|
|
|
if: github.repository_owner == 'NixOS'
|