Use composite action to reuse setup steps (#433)
* Add github action to check flake groups * Run on pull_requests and filter ~files~ *paths* * Use composite action to reuse setup steps * Use common setuo for frontend action * Fix path to action * Remove checkout action from common setup Checkout needed to fetch action * Provide secrets to action Co-authored-by: Rok Garbas <rok@garbas.si>
This commit is contained in:
parent
96eeff25d3
commit
2b7ce58d2f
23
.github/actions/common-setup/action.yml
vendored
Normal file
23
.github/actions/common-setup/action.yml
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
name: Setup Environment
|
||||
inputs:
|
||||
CACHIX_SIGNING_KEY: # determines what node version to install
|
||||
required: true
|
||||
description: 'Cachix Signing Key'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
- 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: '${{ inputs.CACHIX_SIGNING_KEY }}'
|
||||
|
||||
- name: Installing jq
|
||||
shell: bash
|
||||
run: |
|
||||
nix-env -f '<nixpkgs>' -iA jq
|
22
.github/workflows/check-flake-files.yml
vendored
22
.github/workflows/check-flake-files.yml
vendored
|
@ -16,7 +16,7 @@ jobs:
|
|||
|
||||
env:
|
||||
RUST_LOG: debug
|
||||
|
||||
|
||||
steps:
|
||||
|
||||
- name: Checking out the repository
|
||||
|
@ -24,24 +24,10 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Installing Nix
|
||||
uses: cachix/install-nix-action@v16
|
||||
- name: Setup
|
||||
uses: ./.github/actions/common-setup
|
||||
with:
|
||||
install_url: https://nixos-nix-install-tests.cachix.org/serve/i6laym9jw3wg9mw6ncyrk6gjx4l34vvx/install
|
||||
install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve'
|
||||
extra_nix_config: |
|
||||
experimental-features = nix-command flakes
|
||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: cachix/cachix-action@v10
|
||||
with:
|
||||
name: nixos-search
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||
|
||||
- name: Install unstable channel
|
||||
run: |
|
||||
nix-channel --add https://nixos.org/channels/nixpkgs-unstable
|
||||
nix-channel --update
|
||||
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||
|
||||
- name: Building import_scripts
|
||||
run: |
|
||||
|
|
11
.github/workflows/frontend.yml
vendored
11
.github/workflows/frontend.yml
vendored
|
@ -13,13 +13,12 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Installing Nix
|
||||
uses: cachix/install-nix-action@v16
|
||||
|
||||
- uses: cachix/cachix-action@v10
|
||||
- name: Setup
|
||||
uses: ./.github/actions/common-setup
|
||||
with:
|
||||
name: nixos-search
|
||||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
|
||||
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||
|
||||
|
||||
|
||||
- name: Building search.nixos.org
|
||||
run: |
|
||||
|
|
15
.github/workflows/import-flakes.yml
vendored
15
.github/workflows/import-flakes.yml
vendored
|
@ -29,19 +29,12 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Installing Nix
|
||||
uses: cachix/install-nix-action@v16
|
||||
- name: Setup
|
||||
uses: ./.github/actions/common-setup
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixpkgs-unstable
|
||||
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||
|
||||
- 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: |
|
||||
|
|
16
.github/workflows/import-nixpkgs.yml
vendored
16
.github/workflows/import-nixpkgs.yml
vendored
|
@ -25,25 +25,17 @@ jobs:
|
|||
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
|
||||
- name: Setup
|
||||
uses: ./.github/actions/common-setup
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixpkgs-unstable
|
||||
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
||||
|
||||
- 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: |
|
||||
|
|
Loading…
Reference in a new issue