diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f258df9..8aa2d63 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,18 +1,60 @@ name: Main on: + push: + branches: + - main pull_request: + schedule: + - cron: '0 0 * * 0' + +permissions: + # Allows the EndBug/add-and-commit step to commit the package manager changes, + # adding the AppMap language library and configuration file appmap.yml. + # Once the EndBug/add-and-commit is removed, this permission can be removed, + # unless you need it for other reasons. + contents: write + + # Allows the getappmap/archive-action to write a PR comment with the + # AppMap configuration status. + pull-requests: write jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} - name: Set up Ruby uses: ruby/setup-ruby@v1 with: bundler-cache: true + # Begin AppMap CI language agent installation. + # This snippet can be safely removed once the AppMap language agent has been + # added to the project dependencies, and appmap.yml has been created. + - name: Enable appmap gem update + run: bundle config unset deployment + - name: Install AppMap tools + id: install-appmap + uses: getappmap/install-action@v1 + with: + project-type: bundler + - name: Commit changes + uses: EndBug/add-and-commit@v9 + with: + message: "ci: Add AppMap language agent and appmap.yml" + # End AppMap CI language agent installation + - name: Run tests run: bundle exec rails test + + # Begin AppMap bootstrap archive step + - name: Archive AppMaps + id: appmap-bootstrap-archive-appmaps + uses: getappmap/archive-action@v1 + with: + revision: ${{ github.event.pull_request.base.sha }} + # End AppMap bootstrap archive step diff --git a/.gitignore b/.gitignore index d7277b0..14d840b 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,13 @@ # Ignore db test files. db/test.* + + +# AppMap artifacts +/.appmap + +# Node modules +/node_modules + +# Vendored Ruby gems +/vendor \ No newline at end of file diff --git a/Gemfile b/Gemfile index 55b0796..d7d5ed9 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,8 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby "3.1.2" +gem 'appmap', :groups => [:development, :test] + gem "rails", "7.0.4" gem "image_processing", "1.12.2" gem "active_storage_validations", "0.9.8" diff --git a/Gemfile.lock b/Gemfile.lock index e07d368..1443351 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,6 +74,11 @@ GEM addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) ansi (1.5.0) + appmap (0.102.1) + activesupport + method_source + rack + reverse_markdown autoprefixer-rails (10.4.7.0) execjs (~> 2) aws-eventstream (1.2.0) @@ -245,6 +250,8 @@ GEM regexp_parser (2.6.2) reline (0.3.2) io-console (~> 0.5) + reverse_markdown (2.1.1) + nokogiri rexml (3.2.5) ruby-progressbar (1.11.0) ruby-vips (2.1.4) @@ -307,6 +314,7 @@ PLATFORMS DEPENDENCIES active_storage_validations (= 0.9.8) + appmap aws-sdk-s3 (= 1.114.0) bcrypt (= 3.1.18) bootsnap (= 1.12.0) diff --git a/appmap.yml b/appmap.yml new file mode 100644 index 0000000..cea8de2 --- /dev/null +++ b/appmap.yml @@ -0,0 +1,6 @@ +name: sample_rails_app +packages: + - path: app + - path: lib +language: ruby +appmap_dir: tmp/appmap