Skip to content

Commit 8e082ef

Browse files
committed
DEBUG hijack publish-js workflow for testing
1 parent 03ad9af commit 8e082ef

File tree

1 file changed

+87
-54
lines changed

1 file changed

+87
-54
lines changed

.github/workflows/publish-js-client.yml

Lines changed: 87 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -27,75 +27,108 @@ on:
2727
type: boolean
2828
default: true
2929

30+
# DEBUGGING NEW WORKFLOW, RESTORE THIS FILE AFTER IT IS FINISHED
31+
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.ref }}
34+
cancel-in-progress: true
35+
36+
env:
37+
smir: ""
38+
kmir: "p-token-f8c403f"
39+
proofs: "['test_ptoken_domain_data', 'this_will_fail']"
40+
3041
jobs:
31-
test_js:
32-
name: Test JS client
42+
compile:
43+
name: "Compile P-Token to SMIR JSON"
3344
runs-on: ubuntu-latest
3445
steps:
35-
- name: Git Checkout
46+
- name: "Git Checkout"
3647
uses: actions/checkout@v4
3748

38-
- name: Setup Environment
39-
uses: ./.github/actions/setup
49+
- name: "Provide nightly Rust" # https://github.com/rust-lang/rustup/issues/3409
50+
uses: dtolnay/rust-toolchain@master
4051
with:
41-
cargo-cache-key: cargo-programs
42-
solana: true
43-
44-
- name: Format JS Client
45-
run: pnpm clients:js:format
52+
toolchain: nightly-2024-11-29 # Hardcoded version for stable-mir-json. TODO can we use nix?
4653

47-
- name: Lint JS Client
48-
run: pnpm clients:js:lint
54+
- name: "Provide Nix"
55+
uses: cachix/install-nix-action@v18
4956

50-
- name: Build Programs
51-
run: pnpm programs:build
52-
53-
- name: Test JS Client
54-
run: pnpm clients:js:test
57+
- name: "Build with stable_mir_json"
58+
uses: cachix/nix-shell-action@v3
59+
with:
60+
flakes: github:runtimeverification/stable-mir-json/${{ env.smir }}
61+
script: |
62+
cd p-token
63+
RUSTC=stable_mir_json cargo build --features runtime-verification
64+
- name: "Store SMIR JSON files"
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: p-token.smir
68+
path: ./target/debug/deps/*.smir.json
69+
if-no-files-found: error
70+
retention-days: 1 # only important during workflow run
5571

56-
publish_js:
57-
name: Publish JS client
72+
prepare_matrix:
73+
name: "Prepare proof matrix"
5874
runs-on: ubuntu-latest
59-
needs: test_js
60-
permissions:
61-
contents: write
75+
outputs:
76+
proofs: ${{ steps.split.outputs.matrix }}
6277
steps:
63-
- name: Git Checkout
64-
uses: actions/checkout@v4
65-
with:
66-
token: ${{ secrets.ANZA_TEAM_PAT }}
67-
68-
- name: Setup Environment
69-
uses: ./.github/actions/setup
78+
- name: "Create Proof Array"
79+
run: |
80+
echo "proofs = '${{ env.proofs }}'"
81+
echo "matrix=${{ env.proofs }}" >> $GITHUB_OUTPUT
7082
71-
- name: Ensure NPM_TOKEN variable is set
72-
env:
73-
token: ${{ secrets.NPM_TOKEN }}
74-
if: ${{ env.token == '' }}
83+
run_proof:
84+
name: "Link SMIR and Run Proofs"
85+
needs: compile, prepare_matrix
86+
runs-on: ubuntu-latest
87+
# container:
88+
# image: runtimeverificationinc/kmir:${{ inputs.kmir }}
89+
strategy:
90+
matrix:
91+
proof: ${{ fromJSON(needs.prepare_matrix.outputs.proofs) }}
92+
env:
93+
RUNNER_NAME: "kmir-${{ github.sha }}"
94+
steps:
95+
- name: debug matrix and docker image
7596
run: |
76-
echo "The NPM_TOKEN secret variable is not set"
77-
echo "Go to \"Settings\" -> \"Secrets and variables\" -> \"Actions\" -> \"New repository secret\"."
78-
exit 1
97+
echo "This is proof ${{ matrix.proof }}"
98+
echo "Running with docker image runtimeverificationinc/kmir:${{ env.kmir }}"
99+
- name: Fail
100+
run: exit 1
101+
# - name: "Checkout"
102+
# uses: actions/checkout@v4
79103

80-
- name: NPM Authentication
81-
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
82-
env:
83-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
104+
# - name: "Set up Docker host"
105+
# run: |
106+
# docker run --rm --detach \
107+
# --user github-user \
108+
# -v $PWD:/workdir --workdir /workdir \
109+
# --name "${RUNNER_NAME}" \
110+
# runtimeverificationinc/kmir:${{ inputs.kmir }}
111+
# sleep 10
84112

85-
- name: Set Git Author
86-
run: |
87-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
88-
git config --global user.name "github-actions[bot]"
113+
# - name: "Get SMIR Files"
114+
# uses: actions/download-artifact@v5
115+
# with:
116+
# name: p-token.smir
117+
# path: p-token/test-properties/artefacts/
89118

90-
- name: Publish JS Client
91-
id: publish
92-
run: pnpm clients:js:publish ${{ inputs.level }} ${{ inputs.tag }}
119+
# - name: "Link SMIR Files"
120+
# run: |
121+
# docker exec --user github-user --workdir /workdir/p-token/test-properties/artefacts/ "${RUNNER_NAME}" \
122+
# bash -c 'kmir link -o p-token.smir.json *.smir.json'
93123

94-
- name: Push Commit and Tag
95-
run: git push origin --follow-tags
124+
# - name: "Run Proof ${{ matrix.proof }} with default proof settings"
125+
# run: |
126+
# docker exec --user github-user --workdir /workdir/p-token/test-properties/ "${RUNNER_NAME}" \
127+
# ./run-proofs.sh ${{ matrix.proof }}'
96128

97-
- name: Create GitHub release
98-
if: github.event.inputs.create_release == 'true'
99-
uses: ncipollo/release-action@v1
100-
with:
101-
tag: js@v${{ steps.publish.outputs.new_version }}
129+
# - name: "Shut down docker image"
130+
# if: always
131+
# run: |
132+
# docker stop ${RUNNER_NAME}
133+
# sleep 5
134+
# docker rm -f ${RUNNER_NAME}

0 commit comments

Comments
 (0)