Skip to content

Commit

Permalink
Try using composite gha workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Jan 28, 2025
1 parent f339ed1 commit 5a258f7
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 145 deletions.
23 changes: 23 additions & 0 deletions .github/actions/nix-cachix-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Checkout With Cachix
description: Checkout a repository and also set up nix

inputs:
authToken:
required: true

runs:
using: composite

steps:
- name: ❄ Prepare nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
with:
name: cardano-scaling
authToken: '${{ inputs.authToken }}'
24 changes: 4 additions & 20 deletions .github/workflows/binaries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,9 @@ jobs:
# Also ensure we have all history with all tags
fetch-depth: 0

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: ./.github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 🕵 Determine version
Expand Down Expand Up @@ -64,17 +56,9 @@ jobs:
# Also ensure we have all history with all tags
fetch-depth: 0

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
- name: ❄ Setup Nix/Cachix
uses: .github/actions/nix-cachix-setup
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 🕵 Determine version
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/cardano-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ jobs:
repository: IntersectMBO/cardano-node
ref: 8.7.2

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Setup Nix/Cachix
uses: .github/actions/nix-cachix-setup
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❄ Build cardano-node static executables
run: |
Expand All @@ -49,12 +48,10 @@ jobs:
repository: ch1bo/cardano-node
ref: 170817f5ba3f7838ffd9bd181bc30504906a6506

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: .github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❄ Build executables
run: |
Expand Down
80 changes: 15 additions & 65 deletions .github/workflows/ci-nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,9 @@ jobs:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: ./.github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❓ Test
Expand Down Expand Up @@ -113,17 +105,9 @@ jobs:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
- name: ❄ Setup Nix/Cachix
uses: ./.github/actions/nix-cachix-setup
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 📚 Documentation (Haddock)
Expand Down Expand Up @@ -157,17 +141,9 @@ jobs:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: ./.github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 📈 Benchmark
Expand Down Expand Up @@ -236,17 +212,9 @@ jobs:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: ./.github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❄ Nix Flake Check
Expand All @@ -261,17 +229,9 @@ jobs:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
- name: ❄ Setup Nix/Cachix
uses: ./.github/actions/nix-cachix-setup
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❄ Build specification PDF
Expand Down Expand Up @@ -299,12 +259,10 @@ jobs:
# Ensure we have all history with all commits
fetch-depth: 0

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: ./.github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: Set up and use the "ci" devShell
uses: nicknovitski/nix-develop@v1
Expand Down Expand Up @@ -369,17 +327,9 @@ jobs:
- name: "Checkout the PR as the 'new' source"
uses: actions/checkout@v4

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
- name: ❄ Setup Nix/Cachix
uses: ./.github/actions/nix-cachix-setup
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: Set up and use the "ci" devShell
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,9 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: .github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 🔨 Build image using nix
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/formatting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@ jobs:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: .github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 📐 Check code formatting
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/network-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,9 @@ jobs:
with:
submodules: true

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: .github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: Set up and use the "ci" devShell
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/publish-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ jobs:
# Also ensure we have all history with all tags
fetch-depth: 0

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: .github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: Set up and use the "ci" devShell
uses: nicknovitski/nix-develop@v1
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/smoke-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ jobs:
with:
submodules: true

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: .github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 🧹 Cleanup hydra-node state
run: |
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/weeder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@ jobs:
- name: 📥 Checkout repository
uses: actions/checkout@v4

- name: Prepare nix
uses: cachix/install-nix-action@v30
- name: Setup Nix/Cachix
uses: ./.github/actions/nix-cachix-setup
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Cachix cache of nix derivations
uses: cachix/cachix-action@v15
with:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: 📐 Check weeder
Expand Down

0 comments on commit 5a258f7

Please sign in to comment.