Skip to content

Commit ac03d57

Browse files
fxgstmraszyk
andauthored
chore: Improve Ninja CI and bump versions for Ninja examples (#1154)
* Bump CI dfx version for ninja * Bump devcontainer files * Lock * Rm lock * Bump, dont install dfx twice * yeah double install * bump package versions * Rm lockfiles * Bump packages * Bump mops base packages * Sync system time? * Fix * Rm time setting thing * Dont run in container * update * dont fail fast * Downgrade base * downgrade image and dfx * Re bump * Trace * verbose * sleep * ping * nowallet * dummy * dummy * default * ubuntu * debug * debug * debug * debug * debug * debug * debug * debug * debug * debug * debug * delay * delay * debug * debug * Use ubuntu-24.04 * Change back * Use namespace runner * Use mac runner * Use linux arm runner * Dont use container * Dont use container * Dont use container * Dont use container * Use container * Use container in magic mode * Newling * Separate * Revert "Separate" This reverts commit 3d24ef5. --------- Co-authored-by: Martin Raszyk <[email protected]>
1 parent 7e4b625 commit ac03d57

File tree

69 files changed

+110
-52616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+110
-52616
lines changed

.github/workflows/ninja_pr_checks.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ concurrency:
1212
jobs:
1313
check-ninja-example-changes:
1414
name: Filter projects
15-
runs-on: ubuntu-22.04
15+
runs-on: ubuntu-24.04
1616
outputs:
1717
matrix: ${{ steps.set-matrix.outputs.matrix }}
1818
has_examples: ${{ steps.set-matrix.outputs.has_examples }}
@@ -51,13 +51,22 @@ jobs:
5151
["Tokenmania (Rust)"]="rust/tokenmania"
5252
["Who Am I (Rust)"]="rust/who_am_i"
5353
)
54+
55+
# Check if we should run all examples (workflow file changed) or just changed ones
56+
run_all_examples=false
57+
if echo "$changed_files" | grep -q "^\.github/workflows/ninja_pr_checks\.yml$"; then
58+
echo "Workflow file changed. Running all examples."
59+
run_all_examples=true
60+
fi
61+
5462
for name in "${!example_paths[@]}"; do
5563
path=${example_paths[$name]}
56-
echo "Checking path: $path"
5764
58-
if echo "$changed_files" | grep -q "^$path/"; then
65+
if [ "$run_all_examples" = true ] || echo "$changed_files" | grep -q "^$path/"; then
5966
examples+=("{\"name\": \"$name\", \"path\": \"$path\"}")
6067
echo "Added example: $name with path $path"
68+
else
69+
echo "Skipping example: $name (no changes in $path)"
6170
fi
6271
done
6372
@@ -76,9 +85,10 @@ jobs:
7685
name: Build
7786
needs: check-ninja-example-changes
7887
if: needs.check-ninja-example-changes.outputs.has_examples == 'true'
79-
runs-on: ubuntu-22.04
80-
container: ghcr.io/dfinity/icp-dev-env-slim:17
88+
runs-on: ubuntu-24.04
89+
container: ghcr.io/dfinity/icp-dev-env-slim:20
8190
strategy:
91+
fail-fast: false
8292
matrix: ${{ fromJson(needs.check-ninja-example-changes.outputs.matrix) }}
8393

8494
steps:
@@ -87,10 +97,12 @@ jobs:
8797

8898
- name: Install dfx # This is a temporary workaround. Dfx is already installed in the container, but it does not start in the next step if we don't install it here again.
8999
uses: dfinity/setup-dfx@main
100+
with:
101+
dfx-version: "0.27.0"
90102

91-
- name: Start dfx
92-
run: dfx start --background
93-
94-
- name: Build project
103+
- name: Start dfx and build project
95104
working-directory: ${{ matrix.example.path }}
96-
run: dfx deploy
105+
run: |
106+
# Note: Running these commands in the same step and with verbose output magically fixes the 502 Bad Gateway issue in dfx/pocketic for the LLM Chatbot example
107+
RUST_LOG=trace dfx start --background --verbose
108+
dfx deploy

hosting/my_crypto_blog/.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ICP Dev Environment",
3-
"image": "ghcr.io/dfinity/icp-dev-env-slim:17",
3+
"image": "ghcr.io/dfinity/icp-dev-env-slim:20",
44
"forwardPorts": [4943, 5173],
55
"portsAttributes": {
66
"4943": {

hosting/my_crypto_blog/frontend/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
"dev": "vite"
99
},
1010
"dependencies": {
11-
"@dfinity/agent": "2.2.0",
12-
"@dfinity/auth-client": "2.2.0",
13-
"@dfinity/candid": "2.2.0",
14-
"@dfinity/principal": "2.2.0",
11+
"@dfinity/agent": "2.4.1",
12+
"@dfinity/auth-client": "2.4.1",
13+
"@dfinity/candid": "2.4.1",
14+
"@dfinity/principal": "2.4.1",
1515
"react": "18.3.1",
1616
"react-dom": "18.3.1"
1717
},

0 commit comments

Comments
 (0)