Skip to content

Commit 68a8a8a

Browse files
authored
Merge pull request #209 from bcgov/chore/housekeeping
Dependency updates & repo reorganization
2 parents 07e18eb + 7ceee19 commit 68a8a8a

59 files changed

Lines changed: 205 additions & 99 deletions

Some content is hidden

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

.devcontainer/buildDevcontainer.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
MKDOCS_MATERIAL_VERSION="${MKDOCS_MATERIAL_VERSION:-9.7.7}"
6+
AJV_CLI_VERSION="${AJV_CLI_VERSION:-5.0.0}"
7+
8+
SUDO=""
9+
if command -v sudo >/dev/null 2>&1; then
10+
SUDO="sudo"
11+
fi
12+
13+
# Install build and runtime prerequisites used by repo scripts.
14+
${SUDO} apt-get update
15+
${SUDO} apt-get install -y clang lld rsync
16+
17+
# Install docs and schema validation tooling used in CI/workflows.
18+
python3 -m venv "$HOME/.venv"
19+
"$HOME/.venv/bin/pip" install --upgrade "mkdocs-material==${MKDOCS_MATERIAL_VERSION}"
20+
npm install -g "ajv-cli@${AJV_CLI_VERSION}"
21+
22+
# Build parser in a temp dir so the script is idempotent and leaves no repo noise.
23+
tmpdir="$(mktemp -d)"
24+
trap 'rm -rf "$tmpdir"' EXIT
25+
26+
git clone --depth 1 https://github.com/bcgov/oca-parser-xls.git "$tmpdir/oca-parser-xls"
27+
cd "$tmpdir/oca-parser-xls"
28+
RUSTFLAGS="-C link-arg=-fuse-ld=lld" cargo build
29+
30+
# Install to common user bin locations.
31+
mkdir -p "$HOME/bin" "$HOME/.local/bin"
32+
cp ./target/debug/parser "$HOME/bin/parser"
33+
cp ./target/debug/parser "$HOME/.local/bin/parser"
34+
chmod +x "$HOME/bin/parser" "$HOME/.local/bin/parser"
35+
36+
# Update PATH for the current session so verification below succeeds.
37+
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/.venv/bin"
38+
39+
# Ensure bin folders are on PATH for future interactive shells.
40+
if ! grep -q '\$HOME/bin' "$HOME/.bashrc" 2>/dev/null; then
41+
echo 'export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/.venv/bin"' >> "$HOME/.bashrc"
42+
fi
43+
44+
echo "Installed parser to: $HOME/bin/parser and $HOME/.local/bin/parser"
45+
"$HOME/bin/parser" --version
46+
47+
# Verify that all required commands are available for local workflows.
48+
required_cmds=(
49+
parser
50+
jq
51+
shasum
52+
rsync
53+
mkdocs
54+
ajv
55+
cargo
56+
clang
57+
lld
58+
)
59+
60+
for cmd in "${required_cmds[@]}"; do
61+
if ! command -v "$cmd" >/dev/null 2>&1; then
62+
echo "ERROR: Required command not found after setup: $cmd"
63+
exit 1
64+
fi
65+
done
66+
67+
echo "mkdocs version: $(mkdocs --version)"
68+
echo "ajv version: $(ajv --version)"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"features": {
3+
"ghcr.io/devcontainers/features/python": {
4+
"version": "1.8.0",
5+
"resolved": "ghcr.io/devcontainers/features/python@sha256:fbcad6955caeecc5ad3f7886baf652e25cba5225a6c4c2287c536de2e5607511",
6+
"integrity": "sha256:fbcad6955caeecc5ad3f7886baf652e25cba5225a6c4c2287c536de2e5607511"
7+
},
8+
"ghcr.io/devcontainers/features/rust:1": {
9+
"version": "1.5.1",
10+
"resolved": "ghcr.io/devcontainers/features/rust@sha256:f7afd923fd283db88ca961342ae65ea63a8c95bcf86e42c4c363f43bc4ba26a5",
11+
"integrity": "sha256:f7afd923fd283db88ca961342ae65ea63a8c95bcf86e42c4c363f43bc4ba26a5"
12+
},
13+
"ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {
14+
"version": "1.2.2",
15+
"resolved": "ghcr.io/eitsupi/devcontainer-features/jq-likes@sha256:0e50914cd023da7c9520383e93209279147858a991b696e44d26965ea3463b5e",
16+
"integrity": "sha256:0e50914cd023da7c9520383e93209279147858a991b696e44d26965ea3463b5e"
17+
}
18+
}
19+
}

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Node.js & TypeScript",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/typescript-node:0-16",
6+
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
77
"features": {
88
"ghcr.io/devcontainers/features/rust:1": {},
99
"ghcr.io/eitsupi/devcontainer-features/jq-likes:1": {},
@@ -15,9 +15,9 @@
1515
// Use 'forwardPorts' to make a list of ports inside the container available locally.
1616
// "forwardPorts": [],
1717
// Use 'postCreateCommand' to run commands after the container is created.
18-
"postCreateCommand": "bash scripts/buildDevcontainer.sh",
18+
"postCreateCommand": "bash .devcontainer/buildDevcontainer.sh",
1919
"remoteEnv": {
20-
"PATH": "${containerEnv:PATH}:${containerEnv:HOME}/bin:${containerEnv:HOME}/.local/bin:${workspaceFolder}/scripts"
20+
"PATH": "${containerEnv:PATH}:${containerEnv:HOME}/bin:${containerEnv:HOME}/.local/bin:${containerEnv:HOME}/.venv/bin:${workspaceFolder}/scripts"
2121
},
2222
"customizations": {
2323
"vscode": {

.github/workflows/ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
name: ci
1+
name: ci
22
on:
33
push:
44
branches:
55
- main
6+
env:
7+
MKDOCS_MATERIAL_VERSION: 9.7.7
68
permissions:
79
contents: write
810
jobs:
@@ -17,14 +19,14 @@ jobs:
1719
- uses: actions/setup-python@v6
1820
with:
1921
python-version: 3.x
20-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
22+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
2123
- uses: actions/cache@v5
2224
with:
23-
key: mkdocs-material-${{ env.cache_id }}
25+
key: mkdocs-material-${{ env.MKDOCS_MATERIAL_VERSION }}-${{ env.cache_id }}
2426
path: .cache
2527
restore-keys: |
26-
mkdocs-material-
28+
mkdocs-material-${{ env.MKDOCS_MATERIAL_VERSION }}-
2729
- run: chmod ug+x scripts/genMkdocsSite.sh
2830
- run: scripts/genMkdocsSite.sh
29-
- run: pip install mkdocs-material
30-
- run: mkdocs gh-deploy --force
31+
- run: pip install "mkdocs-material==${MKDOCS_MATERIAL_VERSION}"
32+
- run: mkdocs gh-deploy --force

.github/workflows/validate.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

7+
env:
8+
AJV_CLI_VERSION: 5.0.0
9+
MKDOCS_MATERIAL_VERSION: 9.7.7
10+
711
permissions:
812
contents: read
913

@@ -16,14 +20,17 @@ jobs:
1620

1721
- name: "Check file existence"
1822
id: check_files
19-
uses: andstor/file-existence-action@v3
20-
with:
21-
files: "OCABundles/**/OCABundle.json"
23+
run: |
24+
if find OCABundles -type f -name 'OCABundle.json' | grep -q .; then
25+
echo "files_exists=true" >> "$GITHUB_OUTPUT"
26+
else
27+
echo "files_exists=false" >> "$GITHUB_OUTPUT"
28+
fi
2229
2330
- name: Commit files
2431
if: steps.check_files.outputs.files_exists == 'true'
2532
run: |
26-
npm install -g ajv-cli
33+
npm install -g "ajv-cli@${AJV_CLI_VERSION}"
2734
ajv validate -s OCABundles/validators/schema.json -d 'OCABundles/**/OCABundle.json'
2835
2936
docs_validation:
@@ -38,7 +45,7 @@ jobs:
3845
python-version: 3.x
3946

4047
- name: Install docs dependencies
41-
run: pip install mkdocs-material
48+
run: pip install "mkdocs-material==${MKDOCS_MATERIAL_VERSION}"
4249

4350
- name: Generate docs site assets
4451
run: ./scripts/genMkdocsSite.sh

OCABundles/schema/bcgov-digital-trust/pilot/DigitalIdentityTrustProgram-OCA.xlsx renamed to OCABundles/schema/_archived/ditp-pilot/DigitalIdentityTrustProgram-OCA.xlsx

File renamed without changes.

OCABundles/schema/bcgov-digital-trust/pilot/OCABundle.json renamed to OCABundles/schema/_archived/ditp-pilot/OCABundle.json

File renamed without changes.

OCABundles/schema/bcgov-digital-trust/pilot/branding.json renamed to OCABundles/schema/_archived/ditp-pilot/branding.json

File renamed without changes.

OCABundles/schema/bcgov-digital-trust/pilot/invitation-background-image-slice.png renamed to OCABundles/schema/_archived/ditp-pilot/invitation-background-image-slice.png

File renamed without changes.

0 commit comments

Comments
 (0)