Repository navigation
129 lines (109 loc) · 4.15 KB
/
Copy pathci.yml
File metadata and controls
129 lines (109 loc) · 4.15 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
name: CI
on:
push:
branches: [master]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: build & test (nix + devenv)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
experimental-features = nix-command flakes
accept-flake-config = true
- name: Set up Cachix
uses: cachix/cachix-action@v17
with:
name: ccslcodevcregit
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: devenv
- name: Install devenv
run: nix profile install github:cachix/devenv/v2.2.1
- name: Prime devenv shell (retry flaky cold-store eval)
run: |
for i in 1 2 3; do
devenv shell -- true && exit 0
echo "devenv eval attempt $i failed; clearing eval cache and retrying"
rm -rf .devenv
done
exit 1
- name: Cache sbt dependencies
uses: actions/cache@v6
with:
path: |
~/.sbt
~/.ivy2/cache
~/.cache/coursier
key: sbt-${{ runner.os }}-${{ hashFiles('**/build.sbt', '**/project/build.properties', '**/project/plugins.sbt') }}
restore-keys: |
sbt-${{ runner.os }}-
- name: Cache cargo dependencies
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
tokenize/rustTokenizer/target
key: cargo-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-${{ runner.os }}-
- name: Build & test blobExec (sbt test assembly, Scala 2.13 / JDK 21)
run: devenv shell -- bash -c 'cd blobExec && sbt -batch test assembly'
- name: Build & test C++ transcoder (srcml2token)
run: devenv shell -- bash -c 'cd tokenize/srcMLtoken && make && make test'
- name: Build & test Rust tokenizer (rust_tokenizer)
run: devenv shell -- bash -c 'cd tokenize/rustTokenizer && make && make test'
- name: "Tokenizer worker: same output as tokenBySha.pl"
run: devenv shell -- bash tests/test_token_worker.sh
- name: Perl tests (prove)
run: devenv shell -- bash -c 'prove tests/t'
- name: Pipeline tests (shell)
run: |
devenv shell -- bash -c 'set -e
for t in tokenize_gate pipeline_workdir_guard ensure_artifacts retokenize_passthrough reblame_passthrough; do
bash "tests/$t.sh"
done'
- name: Dataset tests (pytest)
run: devenv shell -- pytest -q --junitxml=junit-generate-dataset.xml
# `devenv shell -- pytest` does not flush its summary line; read the JUnit XML.
- name: Re-check the pytest JUnit counts
if: always()
shell: bash
run: |
f=junit-generate-dataset.xml
[ -f "$f" ] || { echo "no $f: pytest did not get far enough to write one"; exit 1; }
python3 - "$f" <<'PY'
import sys, xml.etree.ElementTree as ET
root = ET.parse(sys.argv[1]).getroot()
s = root.find("testsuite") if root.tag == "testsuites" else root
a = s.attrib
print(f"tests={a['tests']} failures={a['failures']} "
f"errors={a['errors']} skipped={a['skipped']}")
if int(a["failures"]) or int(a["errors"]):
sys.exit("failures or errors in the suite")
PY
- name: Upload the pytest JUnit report
if: always()
uses: actions/upload-artifact@v4
with:
name: junit-generate-dataset
path: junit-generate-dataset.xml
if-no-files-found: warn
- name: Build & test legacy onejar modules (sbt test one-jar, Scala 2.10 / JDK 8)
run: |
devenv shell -- bash -c '
set -e
for m in slickGitLog persons remapCommits; do
echo "::group::$m"
( cd "$m" && sbt --java-home "$LEGACY_JAVA_HOME" -batch test one-jar )
echo "::endgroup::"
done'