Created
July 26, 2020 20:03
-
-
Save lucianghinda/ec2681838dd64886fc525afbcf0e07ff to your computer and use it in GitHub Desktop.
Github Actions Workflow to verify if included packages licenses are allowed
This file contains 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
name: Verify Licenses | |
on: [push] | |
jobs: | |
licenses: | |
name: Verify Gem Licenses | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Ruby 2.7 | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7.1 | |
- name: Cache gems | |
uses: actions/cache@v2 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-licensed-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-licensed- | |
- name: Install gems | |
run: | | |
sudo apt-get install libsqlite3-dev | |
bundle config path vendor/bundle | |
bundle config set with 'licensed' | |
bundle install --jobs 4 --retry 3 | |
- name: Update licenses list in cache | |
run: bundle exec licensed cache | |
- name: Check gems and npm modules | |
run: bundle exec licensed status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment