-
Notifications
You must be signed in to change notification settings - Fork 19
123 lines (106 loc) · 3.95 KB
/
Copy pathcheck-test.yml
File metadata and controls
123 lines (106 loc) · 3.95 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
name: check-test
permissions:
contents: read
issues: read
checks: write
pull-requests: write
on:
workflow_dispatch:
push:
branches:
- main
- latest
pull_request:
# If new code is pushed to a PR branch, then cancel in progress workflows for that PR.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash -xe {0}
jobs:
ci-test:
name: ci-test ${{ matrix.name }}
runs-on: ubuntu-24.04
env:
# kache 0.12 can report build-script hits without restoring Cargo's expected executable.
KACHE_CACHE_EXECUTABLES: "0"
strategy:
fail-fast: false
matrix:
include:
- name: test.sh
report: junit-default.xml
features: ""
- name: test-js-local.sh
report: junit-js-local.xml
features: "-F activity-js-local,workflow-js-local,webhook-js-local"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Start postgres
run: docker run -d -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:18
- name: Populate the nix store
run: nix develop --command echo
# Test WASMs are content-hashed by filename and don't change often, so they share one global cache.
- id: wasm-cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
target/wasm-cache
test-codegen-cache
key: wasm-cache-${{ matrix.report }}-${{ runner.os }}-${{ github.run_id }}
restore-keys: |
wasm-cache-${{ matrix.report }}-${{ runner.os }}-
- uses: kunobi-ninja/kache-action@a257c055543c2840700a9bbca8f9c3094a421b1b # main, post-v1: adds pr-comment input
with:
pr-comment: false
- name: Build tests
id: build-tests
run: nix develop --command cargo nextest run --workspace --no-run
- name: Populate codegen cache
run: nix develop --command scripts/test-phase1.sh
env:
ADDITIONAL_FEATURES: ${{ matrix.features }}
- name: Run tests
run: nix develop --command scripts/test-phase2.sh
env:
CI: true
TEST_POSTGRES_HOST: "localhost"
TEST_POSTGRES_USER: "postgres"
TEST_POSTGRES_PASSWORD: "postgres"
TEST_POSTGRES_DATABASE_PREFIX: "obelisk_test"
CARGO_INSTA_TEST: true # reject unreferenced snapshots
ADDITIONAL_FEATURES: ${{ matrix.features }}
# Reduce cache size — hashed WASMs are cached separately (target/wasm-cache/).
- name: Clean build artifacts before caching
if: always()
run: |
rm -rf target/debug/incremental target/release_testprograms target/release_wasm_runtime
- name: Save wasm cache
if: always() && steps.build-tests.outcome == 'success'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
target/wasm-cache
test-codegen-cache
key: ${{ steps.wasm-cache.outputs.cache-primary-key }}
# Report results
- name: Rename test report
if: always()
run: mv target/nextest/ci-test/junit.xml target/nextest/ci-test/${{ matrix.report }}
- name: Upload test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: ${{ matrix.report }}
path: target/nextest/ci-test/${{ matrix.report }}
- name: Report results in GitHub UI
uses: dorny/test-reporter@a43b3a5f7366b97d083190328d2c652e1a8b6aa2
if: always()
with:
name: Rust tests
path: target/nextest/ci-test/${{ matrix.report }}
reporter: java-junit