Skip to content

Commit

Permalink
Add test job
Browse files Browse the repository at this point in the history
  • Loading branch information
buty4649 committed May 26, 2023
1 parent 8708a4a commit 3115233
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 12 deletions.
49 changes: 44 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,49 @@ jobs:
ruby-version: 3.2
- name: build
run: rake build:ci
- name: Upload test binary
- name: Upload test binary (linux-amd64)
uses: actions/upload-artifact@v3
with:
name: test-binary
path: |
release/*.tar.gz
release/*.zip
name: rf-${{ github.sha }}-linux-amd64
path: build/linux-amd64/bin/rf
- name: Upload test binary (darwin-amd64)
uses: actions/upload-artifact@v3
with:
name: rf-${{ github.sha }}-darwin-amd64
path: build/darwi-amd64/bin/rf

test-on-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: rf-${{ github.sha }}-linux-amd64
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
- name: Install dependencies
run: bundle install
- name: Run test
run: |
mkdir -p build/bin
mv build/linux-amd64/bin/rf build/bin/rf
rake spec
test-on-macos:
runs-on: macos-latest
steps:
- uses: actions/download-artifact@v3
with:
name: rf-${{ github.sha }}-darwin-amd64
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
- name: Install dependencies
run: bundle install
- name: Run test
run: |
mkdir -p build/bin
mv build/darwin-amd64/bin/rf build/bin/rf
rake spec
4 changes: 1 addition & 3 deletions .github/workflows/rubocop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
with:
ruby-version: 3.2
- name: Install dependencies
run: |
gem install bundler --no-document
bundle install
run: bundle install
- name: Run rubocop
run: bundle exec rubocop
4 changes: 0 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ namespace :build do
task 'ci' do
env = ["MRUBY_BUILD_TARGETS=#{ci_build_targets.join(',')}"]
docker_run(env:)

sha = ENV['GITHUB_SHA'] || `git rev-parse HEAD`.chomp
version = sha[0..6]
archive_binary_file(ci_build_targets, version)
end
end

Expand Down

0 comments on commit 3115233

Please sign in to comment.