-
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (138 loc) · 5.71 KB
/
Copy pathe2e.yml
File metadata and controls
139 lines (138 loc) · 5.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# End-to-end and integration tests for OPSM (Odds & Sods Package Manager).
#
# Jobs:
# e2e-opsm — offline E2E suite (runs on every push/PR)
# runtime-api — runtime version API integration tests (external_api tag, no downloads)
# live-download — full runtime install pipeline, incl. nickel plugin
# evaluation (workflow_dispatch only, see below)
#
# :live_download tests (full tool installs ~10-50MB) are workflow_dispatch only
# to avoid burning bandwidth on every commit; run manually when validating
# the install pipeline end-to-end.
name: E2E — OPSM Package Resolution
on:
push:
branches: [main, master, develop]
paths:
- 'opsm_ex/**'
- '.github/workflows/e2e.yml'
pull_request:
branches: [main, master]
paths:
- 'opsm_ex/**'
workflow_dispatch:
permissions: read-all
actions: read
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e-opsm:
name: E2E — Dependency Resolution + Lockfile + Trust
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Erlang/Elixir
uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
with:
# Versions derive from opsm.toml [runtime] via .tool-versions
# (generated by `just toolchain-sync` — see docs/TOOLCHAIN.adoc)
version-file: '.tool-versions'
version-type: 'strict'
- name: Restore Mix cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v4
with:
path: |
opsm_ex/deps
opsm_ex/_build
key: ${{ runner.os }}-mix-${{ hashFiles('opsm_ex/mix.lock') }}
- name: Install dependencies
run: cd opsm_ex && mix deps.get
- name: Compile
run: cd opsm_ex && mix compile --warnings-as-errors
- name: Run E2E tests (includes error-handling + workspace audit scenarios)
run: cd opsm_ex && mix test test/integration/e2e_test.exs --include e2e --include integration --trace
- name: Run all tests (unit + integration, excluding e2e/external_api/requires_nif)
run: cd opsm_ex && mix test --trace
runtime-api:
name: Runtime — live version API integration (external_api, no downloads)
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Erlang/Elixir
uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
with:
# Versions derive from opsm.toml [runtime] via .tool-versions
# (generated by `just toolchain-sync` — see docs/TOOLCHAIN.adoc)
version-file: '.tool-versions'
version-type: 'strict'
- name: Restore Mix cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v4
with:
path: |
opsm_ex/deps
opsm_ex/_build
key: ${{ runner.os }}-mix-${{ hashFiles('opsm_ex/mix.lock') }}
- name: Install dependencies
run: cd opsm_ex && mix deps.get
- name: Compile
run: cd opsm_ex && mix compile --warnings-as-errors
- name: Run runtime API integration tests (versions fetch + URL validation, no downloads)
run: |
cd opsm_ex && mix test test/opsm/runtime/integration_test.exs \
--include external_api \
--exclude live_download \
--trace
live-download:
name: Runtime — live install (workflow_dispatch only)
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Rust toolchain (to build nickel)
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
with:
toolchain: '1.97.0'
- name: Cache cargo-installed tools
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
with:
key: nickel-lang-cli-1.16.0
- name: Install nickel
# Pinned to opsm.toml [runtime] — see docs/TOOLCHAIN.adoc. Manager.install
# (opsm_ex/lib/opsm/runtime/manager.ex) shells out to the `nickel` binary
# to evaluate runtime/core/*.ncl plugin definitions; without it every
# install fails with {:error, {:nickel_not_installed, tool}}.
run: cargo install nickel-lang-cli --version 1.16.0 --locked
- name: Setup Erlang/Elixir
uses: erlef/setup-beam@54075bcc5e249e4758d363f27d099f55d843f124 # v1.24.1
with:
# Versions derive from opsm.toml [runtime] via .tool-versions
# (generated by `just toolchain-sync` — see docs/TOOLCHAIN.adoc)
version-file: '.tool-versions'
version-type: 'strict'
- name: Restore Mix cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v4
with:
path: |
opsm_ex/deps
opsm_ex/_build
key: ${{ runner.os }}-mix-${{ hashFiles('opsm_ex/mix.lock') }}
- name: Install dependencies
run: cd opsm_ex && mix deps.get
- name: Compile
run: cd opsm_ex && mix compile --warnings-as-errors
- name: Run live-download runtime install tests (full zig install via Manager.install)
run: |
cd opsm_ex && mix test test/opsm/runtime/integration_test.exs \
--include external_api \
--include live_download \
--trace