Skip to content

Commit ebd539d

Browse files
authored
Merge pull request #1614 from input-output-hk/fix/reject-prs-without-linux-esbuild
fix: reject PRs without `@esbuild/linux-x64@npm` in `yarn-project.nix` & fix the NixBuild.net integration
2 parents 4371915 + f71a350 commit ebd539d

File tree

1 file changed

+34
-9
lines changed

1 file changed

+34
-9
lines changed

.github/workflows/std.yml

+34-9
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,24 @@ concurrency:
6969
group: std-${{ github.workflow }}-${{ github.ref }}
7070
cancel-in-progress: true
7171
jobs:
72+
check-yarn-project-nix:
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v4
76+
with:
77+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
78+
- run: |
79+
if ! grep -qF '"@esbuild/linux-x64@npm:' yarn-project.nix ; then
80+
echo ' '
81+
echo "Please, make sure that the 'yarn-project.nix' on $(git rev-parse HEAD) still contains '@esbuild/linux-x64@npm' (see your diff)."
82+
echo ' '
83+
echo "Its accidental removal can be caused by running 'yarn install' on macOS."
84+
echo ' '
85+
exit 1
86+
fi
87+
7288
discover:
89+
needs: check-yarn-project-nix
7390
# Don’t run on PRs from forks (no access to secrets):
7491
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
7592
outputs:
@@ -161,12 +178,12 @@ jobs:
161178
if: matrix.target != 'dummy-target'
162179
id: login-ecr
163180
uses: aws-actions/amazon-ecr-login@v1
164-
- uses: nixbuild/nix-quick-install-action@v25
181+
- uses: nixbuild/nix-quick-install-action@v30
165182
if: matrix.target != 'dummy-target'
166-
- uses: nixbuild/nixbuild-action@v17
183+
- uses: nixbuild/nixbuild-action@v20
167184
if: matrix.target != 'dummy-target'
168185
with:
169-
nixbuild_ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
186+
nixbuild_token: ${{ secrets.NIXBUILD_TOKEN }}
170187
generate_summary_for: job
171188
- uses: divnix/std-action/setup-discovery-ssh@main
172189
if: matrix.target != 'dummy-target'
@@ -178,6 +195,14 @@ jobs:
178195
shell: bash
179196
run: |
180197
echo commit: ${{ github.sha }}
198+
- name: Manual NixBuild.net
199+
if: matrix.target != 'dummy-target'
200+
shell: bash
201+
run: |
202+
# We trigger this manually, because some integration has broken between std-action and nixbuild.net:
203+
nix build --no-link --print-build-logs --log-format raw-with-logs \
204+
--eval-store auto --builders "''" --store ssh-ng://eu.nixbuild.net \
205+
github:input-output-hk/cardano-js-sdk/${{ github.sha }}#__std.actions.x86_64-linux.cardano-services.oci-images.cardano-services.publish
181206
- uses: divnix/std-action/run@main
182207
if: matrix.target != 'dummy-target'
183208
with: { ffBuildInstructions: true, remoteStore: 'ssh-ng://eu.nixbuild.net' }
@@ -192,10 +217,10 @@ jobs:
192217
runs-on: ubuntu-22.04
193218
steps:
194219
- uses: actions/checkout@v4
195-
- uses: nixbuild/nix-quick-install-action@v25
196-
- uses: nixbuild/nixbuild-action@v17
220+
- uses: nixbuild/nix-quick-install-action@v30
221+
- uses: nixbuild/nixbuild-action@v20
197222
with:
198-
nixbuild_ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
223+
nixbuild_token: ${{ secrets.NIXBUILD_TOKEN }}
199224
generate_summary_for: job
200225
# Further steps assume AWS_PROFILE=lw, while the official action has no way to specify that profile:
201226
- name: Set up AWS credentials
@@ -297,10 +322,10 @@ jobs:
297322
url: ${{ matrix.url }}
298323
steps:
299324
- uses: actions/checkout@v4
300-
- uses: nixbuild/nix-quick-install-action@v25
301-
- uses: nixbuild/nixbuild-action@v17
325+
- uses: nixbuild/nix-quick-install-action@v30
326+
- uses: nixbuild/nixbuild-action@v20
302327
with:
303-
nixbuild_ssh_key: ${{ secrets.SSH_PRIVATE_KEY }}
328+
nixbuild_token: ${{ secrets.NIXBUILD_TOKEN }}
304329
generate_summary_for: job
305330
# Further steps assume AWS_PROFILE=lw, while the official action has no way to specify that profile:
306331
- name: Set up AWS credentials

0 commit comments

Comments
 (0)