Skip to content

Commit 69b0b9d

Browse files
Add nix smoke test in CI (#85)
* add nix smoke test in CI * change `komet.rust-soroban` to `komet.rust-stellar` * Set Version: 0.1.70 --------- Co-authored-by: devops <[email protected]>
1 parent 44a4f91 commit 69b0b9d

File tree

9 files changed

+1719
-2
lines changed

9 files changed

+1719
-2
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,43 @@ jobs:
9797
- name: 'Tear down Docker'
9898
if: always()
9999
run: docker stop --time=0 ${CONTAINER}
100+
101+
nix:
102+
needs: code-quality-checks
103+
name: 'Nix Tests'
104+
strategy:
105+
fail-fast: false
106+
matrix:
107+
runner: [normal, MacM1] # MacM1 / normal are self-hosted,
108+
runs-on: ${{ matrix.runner }}
109+
timeout-minutes: 60
110+
steps:
111+
- name: 'Check out code'
112+
uses: actions/checkout@v4
113+
with:
114+
fetch-depth: 0
115+
- name: 'Install Nix'
116+
if: ${{ matrix.runner != 'MacM1' }}
117+
uses: cachix/[email protected]
118+
with:
119+
install_url: https://releases.nixos.org/nix/nix-2.24.12/install
120+
extra_nix_config: |
121+
substituters = http://cache.nixos.org https://cache.iog.io
122+
trusted-public-keys = cache.nixos.org
123+
- name: 'Install Cachix'
124+
if: ${{ matrix.runner != 'MacM1' }}
125+
uses: cachix/cachix-action@v16
126+
with:
127+
name: k-framework
128+
- name: 'Build Komet'
129+
env:
130+
NIX_PATH: 'nixpkgs=http://nixos.org/channels/nixos-22.05/nixexprs.tar.xz'
131+
GC_DONT_GC: '1'
132+
run: |
133+
set -euxo pipefail
134+
nix --version
135+
JQ=$(nix-build '<nixpkgs>' -A jq --no-link)/bin/jq
136+
KOMET_BIN=$(nix build .#komet.rust-stellar --print-build-logs --json | $JQ -r '.[].outputs | to_entries[].value')/bin
137+
echo $KOMET_BIN >> $GITHUB_PATH
138+
- name: 'Run smoke test'
139+
run: cd package && ./test-package.sh

package/test-package.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -euxo pipefail
4+
5+
which komet
6+
komet --help
7+
8+
cd test-project
9+
komet prove run --id 'test_true'

package/test-project/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target
2+
test_snapshots

0 commit comments

Comments
 (0)