Merge pull request #917 from CommitChange/use-asdf #2362
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: Main build | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
push: | |
branches: ["supporter_level_goal"] | |
concurrency: | |
group: build--${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-20.04] | |
node: [14.19.1, 16] | |
ruby: ['2.6.10'] | |
postgres: ['13', '16'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
ruby: | |
- 'app/**' | |
- 'bin/**' | |
- 'config/**' | |
- 'db/**' | |
- 'gems/**' | |
- 'lib/**' | |
- 'public/**' | |
- 'script/**' | |
- 'spec/**' | |
- '.ruby-version' | |
- '.rspec' | |
- 'config.ru' | |
- 'Gemfile' | |
- 'Gemfile.lock' | |
- 'Rakefile' | |
js: | |
- '**/*.js*' | |
- '**/*.es6' | |
- '**/*.ts*' | |
- '**/*.json' | |
- package.json | |
- yarn.lock | |
- '.nvmrc' | |
- '.babelrc' | |
- '.bootstraprc' | |
- '.browserlistrc' | |
- name: Setup PostgreSQL with PostgreSQL extensions and unprivileged user | |
uses: Daniel-Marynicz/[email protected] | |
with: | |
postgres_image_tag: ${{ matrix.postgres }}-alpine | |
postgres_user: admin | |
postgres_password: password | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: 'yarn' | |
- name: set CUSTOM_RUBY_VERSION environment variable | |
run: echo "CUSTOM_RUBY_VERSION=${{ matrix.ruby }}" >> $GITHUB_ENV | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby }} | |
bundler-cache: true | |
- run: bin/setup | |
- if: steps.changes.outputs.ruby == 'true' | |
name: run spec | |
run: bin/rake spec | |
- if: steps.changes.outputs.ruby == 'true' | |
run: script/compile-assets.sh | |
- if: steps.changes.outputs.js == 'true' | |
run: yarn build | |
- if: steps.changes.outputs.js == 'true' | |
run: yarn jest |