@@ -9,14 +9,75 @@ concurrency:
9
9
cancel-in-progress : true
10
10
11
11
jobs :
12
- tests :
13
- name : Test
14
- uses : swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
15
- with :
16
- linux_exclude_swift_versions : " [{\" swift_version\" : \" 5.8\" }]"
17
- soundness :
18
- name : Soundness
19
- uses : swiftlang/github-workflows/.github/workflows/soundness.yml@main
20
- with :
21
- license_header_check_project_name : " Swift.org"
22
- api_breakage_check_allowlist_path : " api-breakages.txt"
12
+ # tests:
13
+ # name: Test
14
+ # uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
15
+ # with:
16
+ # linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}]"
17
+ # soundness:
18
+ # name: Soundness
19
+ # uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
20
+ # with:
21
+ # license_header_check_project_name: "Swift.org"
22
+ # api_breakage_check_allowlist_path: "api-breakages.txt"
23
+ performance_test :
24
+ name : Performance test
25
+ runs-on : ubuntu-latest
26
+ container :
27
+ image : swift:latest
28
+ steps :
29
+ - name : apt install
30
+ run : apt-get update && apt-get install -y libjemalloc-dev curl jq
31
+ # - name: Checkout repository
32
+ # uses: actions/checkout@v4
33
+ # with:
34
+ # fetch-depth: 0
35
+ # - name: Mark the workspace as safe
36
+ # # https://github.com/actions/checkout/issues/766
37
+ # run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
38
+ # - name: Measure base branch performance
39
+ # run: |
40
+ # git checkout ${{ github.base_ref }}
41
+ # swift package --package-path Benchmarks/ --allow-writing-to-directory Benchmarks/.benchmarkBaselines/ benchmark baseline update "${{ github.base_ref }}"
42
+ # - name: Measure PR performance
43
+ # run: |
44
+ # git checkout ${{ github.head_ref }}
45
+ # swift package --package-path Benchmarks/ --allow-writing-to-directory Benchmarks/.benchmarkBaselines/ benchmark baseline update "${{ github.head_ref }}"
46
+ # - name: Compare performance measurements
47
+ # id: compare_performance
48
+ # run: |
49
+ # if ! swift package --package-path Benchmarks benchmark baseline check "${{ github.base_ref }}" "${{ github.head_ref }}" > /tmp/comparison.md; then
50
+ # echo "has_significant_changes=true" >> "$GITHUB_OUTPUT"
51
+ # else
52
+ # echo "has_significant_changes=false" >> "$GITHUB_OUTPUT"
53
+ # fi
54
+ - name : Install gh
55
+ # if: ${{ steps.compare_performance.outputs.has_significant_changes == 'true' }}
56
+ # Installation instructions from https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt
57
+ run : |
58
+ (type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
59
+ && sudo mkdir -p -m 755 /etc/apt/keyrings \
60
+ && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
61
+ && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
62
+ && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
63
+ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
64
+ && sudo apt update \
65
+ && sudo apt install gh -y
66
+ - name : Post comment
67
+ # if: ${{ steps.compare_performance.outputs.has_significant_changes == 'true' }}
68
+ env :
69
+ GH_TOKEN : ${{ github.token }}
70
+ run : |
71
+ COMMENT="Test"
72
+ gh pr comment ${{ github.event.number }} --body "$COMMENT"
73
+
74
+ # # JSON_BODY=$(cat /tmp/comparison.md | jq -Rsa)
75
+ # JSON_BODY=$(echo "Test" | jq -Rsa)
76
+ # curl -L \
77
+ # -X POST \
78
+ # -H "Accept: application/vnd.github+json" \
79
+ # -H "Authorization: Bearer ${{ github.token }}" \
80
+ # -H "X-GitHub-Api-Version: 2022-11-28" \
81
+ # https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/comments \
82
+ # -d '{"body": $JSON_BODY}'
83
+
0 commit comments