Repository navigation
77 lines (63 loc) · 2.48 KB
/
Copy pathmodule_test.yml
File metadata and controls
77 lines (63 loc) · 2.48 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
name: Module Test
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
queue: ${{ github.ref == 'refs/heads/master' && 'max' || 'single' }}
jobs:
module_tests:
name: Module tests (Ruby ${{ matrix.ruby }} on ${{ matrix.os }})
env:
GEM_HOME: ${{ github.workspace }}/sandbox_gems
GEM_PATH: ${{ github.workspace }}/sandbox_gems
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
ruby: ['3.3', '3.4', '4.0']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ruby/setup-ruby@651ff0d62c5c79bed6d53ec518387aae20e72c1a # v1.329.0
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Build gem
id: build
shell: bash
run: |
GEM_FILE=$(gem build fastlane.gemspec | grep "File:" | awk '{print $2}')
echo "gem_file=$GEM_FILE" >> $GITHUB_OUTPUT
- name: Install gem in isolated GEM_HOME
shell: bash
run: gem install --no-document --env-shebang "${{ steps.build.outputs.gem_file }}"
- name: Dump installed gems
shell: bash
run: gem list
- name: Run module tests against built gem
shell: bash
run: ./.github/scripts/run_module_tests.sh
- name: Sanity check fastlane CLI
shell: bash
run: |
set -euo pipefail
export PATH="$GEM_HOME/bin:$PATH"
# Verify executables
ruby -e "require 'rubygems/package'; spec = Gem::Package.new('${{ steps.build.outputs.gem_file }}').spec; expected = %w(bin-proxy fastlane match_file); puts \"Gem executables: #{spec.executables}\"; exit(1) unless spec.executables.sort == expected.sort"
# Determine installed fastlane version from the gem
FASTLANE_VERSION=$(ruby -e "require 'fastlane'; puts Fastlane::VERSION")
echo "Detected fastlane version: ${FASTLANE_VERSION}"
# Check version output
VERSION_OUTPUT=$(fastlane --version)
echo "fastlane --version => ${VERSION_OUTPUT}"
if [[ "${VERSION_OUTPUT}" != *"fastlane ${FASTLANE_VERSION}"* ]]; then
echo "Expected 'fastlane ${FASTLANE_VERSION}' in version output" >&2
exit 1
fi
# Run basic command
fastlane actions