-
Notifications
You must be signed in to change notification settings - Fork 8
124 lines (105 loc) · 3.56 KB
/
Copy pathruby.yml
File metadata and controls
124 lines (105 loc) · 3.56 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
name: Build and test rspec-trunk-flaky-tests
on:
push:
branches:
- main
tags:
- "*"
pull_request: {}
workflow_dispatch: {}
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust & Cargo
uses: ./.github/actions/setup_rust_cargo
- name: Setup Ruby
uses: ./.github/actions/setup_ruby
- name: Test ruby package
if: "!cancelled()"
run: |
bundle install
bundle exec rake test
working-directory: rspec-trunk-flaky-tests
env:
TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io
TRUNK_ORG_URL_SLUG: trunk-staging-org
TRUNK_API_TOKEN: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
- name: Validate ruby platform gem
if: "!cancelled()"
uses: ./.github/actions/validate_ruby_platform_gem
build-ruby-gem:
name: Build Ruby gem
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
working-directory: rspec-trunk-flaky-tests
- name: Get commit SHA
id: get-sha
shell: bash
run: |
COMMIT_SHA=$(git rev-parse --short HEAD)
echo "sha=${COMMIT_SHA}" >> $GITHUB_OUTPUT
echo "Setting version to 0.0.0-${COMMIT_SHA}"
- name: Update version with commit SHA
uses: ./.github/actions/update_version
with:
version: 0.0.0-${{ steps.get-sha.outputs.sha }}
file: cli/Cargo.toml
- name: Update Test Report version
uses: ./.github/actions/update_version
with:
version: 0.0.0-${{ steps.get-sha.outputs.sha }}
file: test_report/Cargo.toml
- name: Update Gem version
uses: ./.github/actions/update_version
with:
version: 0.0.0-${{ steps.get-sha.outputs.sha }}
file: rspec-trunk-flaky-tests/rspec_trunk_flaky_tests.gemspec
# this is necessary because the cross-gem action doesn't support reading the Gemfile.lock from the subdirectory
# leading to a mismatch in the rb_sys version
- name: Copy Gemfile.lock to root
run: cp rspec-trunk-flaky-tests/Gemfile.lock ./Gemfile.lock
shell: bash
- name: Build cross-compiled gem
uses: oxidize-rb/actions/cross-gem@v1
with:
platform: x86_64-linux
working-directory: rspec-trunk-flaky-tests
ruby-versions: "3.4"
- name: Upload gem artifact
uses: actions/upload-artifact@v4
with:
name: ruby-gem-pr
path: rspec-trunk-flaky-tests/pkg/*.gem
if-no-files-found: error
retention-days: 1
test-ruby-gem-uploads:
name: Test Ruby gem uploads
runs-on: ubuntu-latest
needs: build-ruby-gem
steps:
- uses: actions/checkout@v4
- name: Download gem artifact
uses: actions/download-artifact@v4
with:
name: ruby-gem-pr
path: .github/actions/test_ruby_gem_uploads/
- uses: ./.github/actions/test_ruby_gem_uploads
with:
ruby-version: "3.4"
trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }}
trunk-public-api-address: https://api.trunk-staging.io
trunk-org-slug: trunk-staging-org
test-collection-id: T5yKSn9h
platform: x86_64-linux
artifact-pattern: ""
knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }}