From c7081d152a8a886f3b3d7672f9393a5210acabd2 Mon Sep 17 00:00:00 2001 From: Pete Cheslock Date: Fri, 22 Dec 2023 10:53:27 -0500 Subject: [PATCH] ci: Set up AppMap (#33) * revertme: (AppMap) Enable install-action to commit to the branch * revertme: (AppMap) Permit install-action to make a commit * revertme: (AppMap) Run install-action * ci: (AppMap) Update workflow triggers * revertme: (AppMap) Create the baseline AppMap archive * ci: Add AppMap language agent and appmap.yml * revert: (AppMap) Create the baseline AppMap archive * ci: (AppMap) Run analysis via reusable workflow --- .github/workflows/main.yml | 20 ++++++++++++++++++++ .gitignore | 5 ++++- Gemfile | 2 ++ Gemfile.lock | 6 ++++++ appmap.yml | 6 ++++++ 5 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 appmap.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 541bf5d..e56fd27 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,9 @@ on: push: branches: - main + pull_request: + schedule: + - cron: '0 0 * * 0' jobs: test: @@ -18,3 +21,20 @@ jobs: - name: Run tests run: bundle exec rails test + + - name: Save AppMaps + uses: actions/cache/save@v3 + if: always() + with: + path: ./tmp/appmap + key: appmaps-${{ github.sha }}-${{ github.run_attempt }} + + appmap-analysis: + if: always() + needs: [ test ] + uses: getappmap/analyze-action/.github/workflows/appmap-analysis.yml@v1 + permissions: + actions: read + contents: read + checks: write + pull-requests: write diff --git a/.gitignore b/.gitignore index d0d715c..4b1986f 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,7 @@ db/test.* /node_modules # Vendored Ruby gems -/vendor \ No newline at end of file +/vendor + +# AppMap artifacts +/.appmap \ 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 98c6827..ebdd3e9 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.2) + activesupport + method_source + rack + reverse_markdown autoprefixer-rails (10.4.7.0) execjs (~> 2) aws-eventstream (1.2.0) @@ -309,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