-
Notifications
You must be signed in to change notification settings - Fork 0
feat: separate test and metanorma workflows #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| name: gem-build | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| platforms: | ||
| description: 'JSON array of platforms to build (e.g., ["x86_64-linux", "arm64-darwin"])' | ||
| required: false | ||
| type: string | ||
| default: '["x64-mingw32", "x64-mingw-ucrt", "x86_64-darwin", "arm64-darwin", "x86_64-linux", "x86_64-linux-gnu", "x86_64-linux-musl", "aarch64-linux", "aarch64-linux-gnu", "aarch64-linux-musl", "any"]' | ||
| workflow_dispatch: | ||
| inputs: | ||
| platforms: | ||
| description: 'JSON array of platforms to build' | ||
| required: false | ||
| type: string | ||
| default: '["x64-mingw32", "x64-mingw-ucrt", "x86_64-darwin", "arm64-darwin", "x86_64-linux", "x86_64-linux-gnu", "x86_64-linux-musl", "aarch64-linux", "aarch64-linux-gnu", "aarch64-linux-musl", "any"]' | ||
|
|
||
| env: | ||
| BUNDLER_VER: latest | ||
|
|
||
| jobs: | ||
| build: | ||
| name: build (${{ matrix.os }}, ${{ matrix.platform }}) | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # Windows platforms | ||
| - os: windows-latest | ||
| platform: x64-mingw32 | ||
| ruby: '3.4' | ||
| - os: windows-latest | ||
| platform: x64-mingw-ucrt | ||
| ruby: '3.4' | ||
| # macOS platforms | ||
| - os: macos-latest | ||
| platform: x86_64-darwin | ||
| ruby: '3.4' | ||
| - os: macos-latest | ||
| platform: arm64-darwin | ||
| ruby: '3.4' | ||
| # Linux x86_64 platforms (gnu and musl) | ||
| - os: ubuntu-latest | ||
| platform: x86_64-linux | ||
| ruby: '3.4' | ||
| - os: ubuntu-latest | ||
| platform: x86_64-linux-gnu | ||
| ruby: '3.4' | ||
| - os: ubuntu-latest | ||
| platform: x86_64-linux-musl | ||
| ruby: '3.4' | ||
| # Linux aarch64 platforms (gnu and musl) | ||
| - os: ubuntu-latest | ||
| platform: aarch64-linux | ||
| ruby: '3.4' | ||
| - os: ubuntu-latest | ||
| platform: aarch64-linux-gnu | ||
| ruby: '3.4' | ||
| - os: ubuntu-latest | ||
| platform: aarch64-linux-musl | ||
| ruby: '3.4' | ||
| # Any platform (source gem) | ||
| - os: ubuntu-latest | ||
| platform: any | ||
| ruby: '3.4' | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.ruby }} | ||
| bundler: ${{ env.BUNDLER_VER }} | ||
| bundler-cache: true | ||
|
|
||
| - if: matrix.platform == 'aarch64-linux' || matrix.platform == 'aarch64-linux-gnu' || matrix.platform == 'aarch64-linux-musl' | ||
| name: Install aarch64 compilers | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu gperf | ||
| echo "CMAKE_TOOLCHAIN_FILE=$(pwd)/toolchain/aarch64-linux-gnu.cmake" >> $GITHUB_ENV | ||
|
|
||
| - if: matrix.platform == 'aarch64-linux-musl' | ||
| name: Install musl cross-compiler for aarch64 | ||
| run: | | ||
| # Install musl-tools for musl builds | ||
| sudo apt-get install musl-tools | ||
| # For aarch64-musl, we'll use musl-gcc wrapper with aarch64-linux-gnu-gcc | ||
| # This creates a musl-targeted build | ||
|
|
||
| - run: bundle exec rake gem:native:${{ matrix.platform }} | ||
|
|
||
| - uses: actions/upload-artifact@v6 | ||
| if: failure() | ||
| with: | ||
| name: build-logs-${{ matrix.platform }} | ||
| path: tmp/*/ports/*/*/*.log | ||
|
|
||
| - if: matrix.platform != 'any' && !startsWith(matrix.platform, 'aarch64-') | ||
| uses: metanorma/metanorma-build-scripts/native-deps-action@main | ||
| with: | ||
| libname: archive | ||
| directory: lib/ffi-libarchive-binary | ||
|
|
||
| - run: | | ||
| cd pkg/ | ||
| gem unpack ffi-libarchive-binary-*.gem | ||
| ls */lib/ffi-libarchive-binary | ||
|
|
||
| - uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: ${{ matrix.platform }}-pkg | ||
| path: pkg/*.gem | ||
|
|
||
| - if: matrix.platform != 'any' | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: lib-${{ matrix.platform }} | ||
| path: lib/ffi-libarchive-binary/libarchive.* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: metanorma | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| tags: [ 'v*' ] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}' | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| BUNDLER_VER: latest | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build gems for metanorma testing | ||
| uses: ./.github/workflows/gem-build.yml | ||
|
|
||
| metanorma: | ||
|
||
| needs: build | ||
| runs-on: ${{ matrix.env.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| ruby: [ '3.2', '3.4' ] | ||
| env: | ||
| - { os: macos-latest, platform: arm64-darwin } | ||
| - { os: ubuntu-latest, platform: x86_64-linux } | ||
| - { os: windows-latest, platform: x64-mingw-ucrt } | ||
| experimental: [true] | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| repository: metanorma/metanorma | ||
|
|
||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| path: pkg | ||
| pattern: '*-pkg' | ||
| merge-multiple: true | ||
|
|
||
| - name: Setup ffi-libarchive-binary | ||
| run: | | ||
| gem unpack --target pkg pkg/ffi-libarchive-binary-*-${{ matrix.env.platform }}.gem | ||
| mv pkg/ffi-libarchive-binary-*-${{ matrix.env.platform }} pkg/ffi-libarchive-binary | ||
| echo "gem 'ffi-libarchive-binary', path: 'pkg/ffi-libarchive-binary'" > Gemfile.devel | ||
|
|
||
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: ${{ matrix.ruby }} | ||
| bundler: ${{ env.BUNDLER_VER }} | ||
| bundler-cache: true | ||
|
|
||
| - uses: metanorma/metanorma-build-scripts/inkscape-setup-action@main | ||
|
|
||
| - run: bundle exec rake | ||
| continue-on-error: ${{ matrix.experimental }} | ||
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: release | ||
|
|
||
| on: | ||
| push: | ||
| tags: [ 'v*' ] | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| BUNDLER_VER: latest | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build gems for release | ||
| uses: ./.github/workflows/gem-build.yml | ||
|
|
||
| release: | ||
|
||
| name: Release to RubyGems | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - uses: actions/download-artifact@v7 | ||
| with: | ||
| path: pkg | ||
| pattern: '*-pkg' | ||
| merge-multiple: true | ||
|
|
||
| - name: Publish to rubygems.org | ||
| env: | ||
| RUBYGEMS_API_KEY: ${{secrets.FONTIST_CI_RUBYGEMS_API_KEY}} | ||
| run: | | ||
| mkdir -p ~/.gem | ||
| touch ~/.gem/credentials | ||
| cat > ~/.gem/credentials << EOF | ||
| --- | ||
| :rubygems_api_key: ${RUBYGEMS_API_KEY} | ||
| EOF | ||
| chmod 0600 ~/.gem/credentials | ||
| gem signin | ||
| mkdir tmp | ||
| for gem in pkg/*.gem; do gem push -V $gem; done | ||
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.