Skip to content

Create workflows that test different integrations from demo project #11

Create workflows that test different integrations from demo project

Create workflows that test different integrations from demo project #11

name: Test Coverage-Reporter
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build_and_test:
name: Test on Ubuntu 22.04
runs-on: ubuntu-22.04
strategy:
matrix:
arch: [x86_64, aarch64]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
bundler-cache: true
- name: Install Ruby dependencies
run: bundle install
- name: Run Tests
run: bundle exec rspec
# For pre-release testing only
- name: Install GitHub CLI
run: sudo apt-get install gh -y
# For pre-release testing only
# Conditionally download and run based on architecture
- name: Download the correct binary from coverage-reporter repo
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ matrix.arch }}" = "x86_64" ]; then
gh run download 10950279748 --repo coverallsapp/coverage-reporter --name coveralls-linux-x86_64 --dir ./;
elif [ "${{ matrix.arch }}" = "aarch64" ]; then
gh run download 10950279748 --repo coverallsapp/coverage-reporter --name coveralls-linux-aarch64 --dir ./;
fi
# Debugging: List files after download
- name: List files
run: ls -l
- name: Unzip and run the correct binary
run: |
if [ "${{ matrix.arch }}" = "x86_64" ]; then
unzip coveralls-linux-x86_64.zip || echo "File not found: coveralls-linux-x86_64.zip";
./coveralls-linux-x86_64;
elif [ "${{ matrix.arch }}" = "aarch64" ]; then
unzip coveralls-linux-aarch64.zip || echo "File not found: coveralls-linux-aarch64.zip";
./coveralls-linux-aarch64;
fi
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}