blob: d27182c0d7be1e86665549bb4c428b90dcd89b0d [file] [log] [blame]
name: Unit test agenda
on:
# push:
# paths:
# - '**/unittestagenda.yml'
# - 'www/board/agenda/**'
# - 'lib/**'
workflow_dispatch:
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
test:
strategy:
max-parallel: 1 # Run sequentially
fail-fast: true
matrix:
os: [ubuntu-20.04, macos-latest]
ruby: [2.7]
# os: [ubuntu-20.04, ubuntu-22.04]
# ruby: [2.7, 3.1]
# 2.7 not supported on 22.04
exclude:
- os: ubuntu-22.04
ruby: 2.7
runs-on: ${{ matrix.os }}
steps:
- name: setup Ubuntu missing header files
if: runner.os != 'macOS'
run: |
sudo apt-get update
sudo apt-get install libldap2-dev
sudo apt-get install libsasl2-dev
sudo apt-get install libyaml-dev # seems to be needed for installing ruby since psych 5.0.0 release
# Default host no longer includes subversion
- name: setup macos
if: runner.os == 'macOS'
run: |
brew install subversion
- uses: actions/setup-node@v4
with:
node-version: 'v21.4.0' # works on macOS
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: setup agenda 1
run: |
cd www/board/agenda
bundle install
- name: setup agenda 2
# need to run the ruby that has all the gems installed
run: |
bash -c 'printf "\n\n\n" >.ldap.txt'
echo ":ldap: ldaps://ldap-us.apache.org:636" >> .whimsy
echo ":ldap_creds: $PWD/.ldap.txt" >> .whimsy
sudo $(which ruby) -I $PWD/lib -r whimsy/asf -e "ASF::LDAP.configure"
- name: show environ
run: |
node -v
npm -v
gem list
- name: test agenda code
run: |
cd www/board/agenda
# SKIP_NAVIGATION=1 bundle exec rake RSPEC_OPTS='--pattern=secret*.rb' || echo "action_state=failed" >> $GITHUB_ENV
SKIP_AUDIT=1 SKIP_NAVIGATION=1 bundle exec rake || echo "action_state=failed" >> $GITHUB_ENV
continue-on-error: true
- name: Run Summary
run: |
npm list # added by Rakefile
echo "${{ env.action_state }}"
# This will be be true for a successful run
test "${{ env.action_state }}" != 'failed'