|
5 | 5 | - pull_request
|
6 | 6 |
|
7 | 7 | jobs:
|
8 |
| - lint: |
| 8 | + shellcheck: |
9 | 9 | runs-on: ubuntu-latest
|
10 | 10 | steps:
|
11 |
| - - name: Checkout code |
| 11 | + - name: Checkout |
12 | 12 | uses: actions/checkout@v4
|
13 |
| - - name: Set up Ruby |
14 |
| - uses: ruby/setup-ruby@v1 |
15 |
| - with: |
16 |
| - ruby-version: 3.2 |
17 |
| - bundler-cache: true |
18 |
| - - name: Linting |
19 |
| - run: bundle exec standardrb --no-fix |
| 13 | + - name: Run ShellCheck |
| 14 | + run: shellcheck *.sh -x |
20 | 15 |
|
21 |
| - test: |
| 16 | + lint: |
22 | 17 | runs-on: ubuntu-latest
|
23 | 18 | steps:
|
24 |
| - - name: Checkout code |
| 19 | + - name: Checkout |
25 | 20 | uses: actions/checkout@v4
|
26 |
| - - name: Set up Ruby |
27 |
| - uses: ruby/setup-ruby@v1 |
28 |
| - with: |
29 |
| - ruby-version: '3.2' |
30 |
| - bundler-cache: true |
31 |
| - - name: test |
32 |
| - run: bundle exec rspec spec |
| 21 | + - name: Update Rust toolchain |
| 22 | + # Most of the time this will be a no-op, since GitHub releases new images every week |
| 23 | + # which include the latest stable release of Rust, Rustup, Clippy and rustfmt. |
| 24 | + run: rustup update |
| 25 | + - name: Rust Cache |
| 26 | + |
| 27 | + - name: Clippy |
| 28 | + # Using --all-targets so tests are checked and --deny to fail on warnings. |
| 29 | + # Not using --locked here and below since Cargo.lock is in .gitignore. |
| 30 | + run: cargo clippy --all-targets --all-features -- --deny warnings |
| 31 | + - name: rustfmt |
| 32 | + run: cargo fmt -- --check |
| 33 | + - name: Check docs |
| 34 | + # Using RUSTDOCFLAGS until `cargo doc --check` is stabilised: |
| 35 | + # https://github.com/rust-lang/cargo/issues/10025 |
| 36 | + run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --document-private-items --no-deps |
33 | 37 |
|
34 |
| - integration_test: |
35 |
| - runs-on: pub-hk-ubuntu-22.04-xlarge |
36 |
| - strategy: |
37 |
| - matrix: |
38 |
| - stack: ["heroku-20", "heroku-22"] |
39 |
| - version: ["3.1.4"] |
| 38 | + unit-test: |
| 39 | + runs-on: ubuntu-latest |
40 | 40 | steps:
|
41 | 41 | - name: Checkout
|
42 | 42 | uses: actions/checkout@v4
|
43 |
| - - name: Output CHANGELOG |
44 |
| - run: bin/print_changelog "${{matrix.version}}" |
45 |
| - - name: Build Docker image |
46 |
| - run: bin/activate_docker "${{matrix.stack}}" |
47 |
| - - name: Build and package Ruby runtime |
48 |
| - run: bin/build_ruby "${{matrix.stack}}" "${{matrix.version}}" |
49 |
| - - name: Verify ruby executable and output rubygems version |
50 |
| - run: bin/print_summary "${{matrix.stack}}" "${{matrix.version}}" | tee $GITHUB_STEP_SUMMARY |
| 43 | + - name: Update Rust toolchain |
| 44 | + run: rustup update |
| 45 | + - name: Rust Cache |
| 46 | + |
| 47 | + - name: Run unit tests |
| 48 | + run: cargo test --all-features |
51 | 49 |
|
52 |
| - integration_test-heroku-24-amd: |
53 |
| - runs-on: pub-hk-ubuntu-22.04-xlarge |
| 50 | + ruby_integration_test: |
| 51 | + runs-on: ${{ matrix.arch == 'arm64' && 'pub-hk-ubuntu-22.04-arm-medium' || 'ubuntu-latest' }} |
54 | 52 | strategy:
|
55 | 53 | matrix:
|
56 |
| - stack: ["heroku-24"] |
| 54 | + base_image: ["heroku-20", "heroku-22", "heroku-24"] |
57 | 55 | version: ["3.2.3"]
|
| 56 | + arch: ["arm64", "amd64"] |
| 57 | + exclude: |
| 58 | + - base_image: "heroku-20" |
| 59 | + arch: "arm64" |
| 60 | + - base_image: "heroku-22" |
| 61 | + arch: "arm64" |
58 | 62 | steps:
|
59 | 63 | - name: Checkout
|
60 | 64 | uses: actions/checkout@v4
|
| 65 | + - name: Update Rust toolchain |
| 66 | + run: rustup update |
| 67 | + - name: Rust Cache |
| 68 | + |
| 69 | + - name: Cargo build (to make test logs shorter) |
| 70 | + run: cargo build |
61 | 71 | - name: Output CHANGELOG
|
62 |
| - run: bin/print_changelog "${{matrix.version}}" |
63 |
| - - name: Build Docker image |
64 |
| - run: bin/activate_docker "${{matrix.stack}}" |
65 |
| - - name: Build and package Ruby runtime |
66 |
| - run: bin/build_ruby "${{matrix.stack}}" "${{matrix.version}}" |
67 |
| - - name: Verify ruby executable and output rubygems version |
68 |
| - run: bin/print_summary "${{matrix.stack}}" "${{matrix.version}}" amd64 | tee $GITHUB_STEP_SUMMARY |
| 72 | + run: cargo run --bin ruby_changelog -- --version "${{matrix.version}}" |
| 73 | + - name: Build Ruby |
| 74 | + run: cargo run --bin ruby_build -- --version ${{matrix.version}} --base-image ${{matrix.base_image}} --arch ${{matrix.arch}} |
| 75 | + - name: Check Ruby |
| 76 | + run: cargo run --bin ruby_check -- --version ${{matrix.version}} --base-image ${{matrix.base_image}} --arch ${{matrix.arch}} |
69 | 77 |
|
70 |
| - integration_test-heroku-24-arm: |
71 |
| - runs-on: pub-hk-ubuntu-22.04-arm-large |
| 78 | + jruby_integration_test: |
| 79 | + runs-on: ${{ matrix.arch == 'arm64' && 'pub-hk-ubuntu-22.04-arm-medium' || 'ubuntu-latest' }} |
72 | 80 | strategy:
|
73 | 81 | matrix:
|
74 |
| - stack: ["heroku-24"] |
75 |
| - version: ["3.2.3"] |
| 82 | + base_image: ["heroku-20", "heroku-22", "heroku-24"] |
| 83 | + version: ["9.4.7.0"] |
| 84 | + arch: ["arm64", "amd64"] |
| 85 | + exclude: |
| 86 | + - base_image: "heroku-20" |
| 87 | + arch: "arm64" |
| 88 | + - base_image: "heroku-22" |
| 89 | + arch: "arm64" |
76 | 90 | steps:
|
77 | 91 | - name: Checkout
|
78 | 92 | uses: actions/checkout@v4
|
79 |
| - # Docker (and other tools) are not present on the early-access runners. |
80 |
| - # We must install them manually: https://github.com/github-early-access/arm-runners-beta |
81 |
| - - name: Install docker |
82 |
| - run: | |
83 |
| - bin/setup_docker_ci |
84 |
| -
|
85 |
| - sudo usermod -aG docker $USER |
86 |
| - sudo apt-get install acl |
87 |
| - sudo setfacl --modify user:$USER:rw /var/run/docker.sock |
88 |
| - # AWS CLI (and other tools) are not present on the early-access runners. |
89 |
| - # We must install them manually: https://github.com/github-early-access/arm-runners-beta |
90 |
| - - name: Install AWS CLI |
91 |
| - run: | # https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html |
92 |
| - sudo apt-get install -y unzip |
93 |
| - curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" |
94 |
| - unzip awscliv2.zip |
95 |
| - sudo ./aws/install |
96 |
| - - name: Verify AWS installed correctly |
97 |
| - run: aws --version |
| 93 | + - name: Update Rust toolchain |
| 94 | + run: rustup update |
| 95 | + - name: Rust Cache |
| 96 | + |
| 97 | + - name: Cargo build (to make test logs shorter) |
| 98 | + run: cargo build |
98 | 99 | - name: Output CHANGELOG
|
99 |
| - run: bin/print_changelog "${{matrix.version}}" |
100 |
| - - name: Build Docker image |
101 |
| - run: bin/activate_docker "${{matrix.stack}}" |
102 |
| - - name: Build and package Ruby runtime |
103 |
| - run: bin/build_ruby "${{matrix.stack}}" "${{matrix.version}}" |
104 |
| - - name: Verify ruby executable and output rubygems version |
105 |
| - run: bin/print_summary "${{matrix.stack}}" "${{matrix.version}}" arm64 | tee $GITHUB_STEP_SUMMARY |
| 100 | + run: cargo run --bin jruby_changelog -- --version "${{matrix.version}}" |
| 101 | + - name: Build JRuby |
| 102 | + run: cargo run --bin jruby_build -- --version ${{matrix.version}} --base-image ${{matrix.base_image}} |
| 103 | + - name: Check JRuby |
| 104 | + run: cargo run --bin jruby_check -- --version ${{matrix.version}} --base-image ${{matrix.base_image}} --arch ${{matrix.arch}} |
0 commit comments