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

#20 move to GHA #21

Merged
merged 1 commit into from
Jul 25, 2021
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
90 changes: 90 additions & 0 deletions .github/workflows/rake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: rake

on:
push:
branches: [ master, main ]
tags: [ v* ]
pull_request:

env:
RNP_VERSION: master
DATABASE_URL: "mysql2://[email protected]/keyserver_test"
DEPS_BUILD_DIR: ${{ github.workspace }}/build
DEPS_PREFIX: ${{ github.workspace }}/opt
BOTAN_PREFIX: ${{ env.DEPS_PREFIX }}/botan
JSONC_PREFIX: ${{ env.DEPS_PREFIX }}/json-c
RNP_PREFIX: ${{ env.DEPS_PREFIX }}/rnp

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' ]
rnp: [ master ]
os: [ ubuntu-latest ]
experimental: [ false ]
include:
- ruby: '2.5'
rnp: v0.10.0
os: ubuntu-latest
- ruby: '2.5'
rnp: v0.11.0
os: ubuntu-latest
- ruby: '2.5'
rnp: v0.12.0
os: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true

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

- uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: '8.0'

- run: mysql -e 'CREATE DATABASE keyserver_test;'

- run: |
mkdir -p ${DEPS_PREFIX}

- working-directory: ci
run: |
./install_botan.sh
./install_json_c.sh
./install_rnp.sh
# Be aware of differences between LD_LIBRARY_PATH and LD_RUN_PATH.
# - http://osr507doc.sco.com/en/tools/ccs_linkedit_dynamic_dirsearch.html
# - https://www.hpc.dtu.dk/?page_id=1180
#
# You should be careful when attempting to replicate following in your
# setup, because setting LD_LIBRARY_PATH is often a bad idea. Nevertheless,
# it is okay here in Travis, and actually any attempt to change these led me
# to linking failures. Side note: I am not a Linux expert, and you may be
# more lucky.
#
# I'd be happy to get rid of LD_LIBRARY_PATH eventually in some future
# pull request.
echo "LD_LIBRARY_PATH=${BOTAN_PREFIX}/lib:${JSONC_PREFIX}/lib:${RNP_PREFIX}/lib" >> $GITHUB_ENV
echo "PATH=${RNP_PREFIX}/bin:${PATH}" >> $GITHUB_ENV

- 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 }}"}'