Skip to content
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

metanorma/metanorma-build-scripts#71 Update workflow to include shared one #172

Merged
merged 1 commit into from
Jan 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 4 additions & 70 deletions .github/workflows/rake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,9 @@ on:
tags: [ v* ]
pull_request:


jobs:
rake:
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
os: [ ubuntu-latest, windows-latest, macos-latest ]
experimental: [ false ]

steps:
- uses: actions/checkout@master

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- uses: actions/setup-python@v1
with:
python-version: '3.10'

- name: set PIP_DOWNLOAD_CACHE
shell: python
run: |
import os
import platform
from os.path import expanduser

home = expanduser("~")
cache_path = {
"Linux": f"{home}/.cache/pip",
"Darwin": f"{home}Library/Caches/pip",
"Windows": f"{home}\\AppData\\Local\\pip\\Cache"
}[platform.system()]

os.system(f"echo PIP_DOWNLOAD_CACHE={cache_path} >> {os.environ['GITHUB_ENV']}")

- uses: actions/cache@v2
with:
path: ${{ env.PIP_DOWNLOAD_CACHE }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: ${{ runner.os }}-pip-

- uses: actions/cache@v2
with:
path: ~/.cache/xml2rfc
key: xml2rfc
restore-keys: xml2rfc

- if: matrix.os == 'macos-latest'
run: brew install libmagic

- if: matrix.os == 'windows-latest'
run: pip install python-magic-bin

- run: pip install xml2rfc

- run: bundle exec rake

tests-passed:
needs: rake
runs-on: ubuntu-latest
steps:
- uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
event-type: tests-passed
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
uses: metanorma/metanorma-build-scripts/.github/workflows/xml2rfc-rake.yml@main
secrets:
pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}