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:
Yannik Sander 2022-02-28 00:10:09 +01:00 committed by GitHub
parent 96eeff25d3
commit 2b7ce58d2f
Failed to generate hash of commit
5 changed files with 40 additions and 47 deletions

23
.github/actions/common-setup/action.yml vendored Normal file
View 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

View file

@ -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: |

View file

@ -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: |

View file

@ -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: |

View file

@ -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: |