diff --git a/.github/actions/easy_compile/action.yml b/.github/actions/easy_compile/action.yml index 2afb31a..d4e9375 100644 --- a/.github/actions/easy_compile/action.yml +++ b/.github/actions/easy_compile/action.yml @@ -9,9 +9,6 @@ inputs: step: description: "The step to run" required: true - token: - description: "TODO this is needed to install the Easy Compile gem from the GitHub repo. Can be removed " - required: false test-command: description: "The command to run the test suite. By default Easy Compile will run either `bundle exec rake test` or `bundle exec rake spec` depending on the test framework used." required: false @@ -20,16 +17,10 @@ inputs: runs: using: "composite" steps: - - name: Checkout easy compile # TODO this can be removed once this tool is pusblished on RubyGems - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 - with: - path: "tmp" - repository: "shopify-playground/edouard-playground" - token: ${{ inputs.token }} - name: Install easy compile # TODO this can be removed once this tool is pusblished on RubyGems shell: bash run: "rake install" - working-directory: "tmp" + working-directory: "${{ github.action_path }}" - name: "Setup Rake Compiler" if: "${{ inputs.step == 'compile' }}" uses: actions/github-script@v8 diff --git a/.github/workflows/e2e-dummy-gem.yml b/.github/workflows/e2e-dummy-gem.yml index 869dcf2..d0e21ed 100644 --- a/.github/workflows/e2e-dummy-gem.yml +++ b/.github/workflows/e2e-dummy-gem.yml @@ -21,7 +21,6 @@ jobs: uses: "./.github/actions/easy_compile" with: step: "compile" - token: ${{ secrets.GITHUB_TOKEN }} working-directory: "test/fixtures/dummy_gem" test: timeout-minutes: 20 @@ -46,7 +45,6 @@ jobs: uses: "./.github/actions/easy_compile" with: step: "test_${{ matrix.type }}" - token: ${{ secrets.GITHUB_TOKEN }} # TODO Remove this before publishing the gem working-directory: "test/fixtures/dummy_gem" install: timeout-minutes: 5 @@ -66,5 +64,4 @@ jobs: - name: "Run easy compile" uses: "./.github/actions/easy_compile" with: - token: ${{ secrets.GITHUB_TOKEN }} # TODO Remove this before publishing the gem step: "install" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e6ef91..7f8bb4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,6 +34,11 @@ jobs: - name: "Compile when target has rake as dependency" working-directory: "test/fixtures/dummy_gem" run: "easy_compile compile" + - name: "Bundle install on target gem" + working-directory: "test/fixtures/dummy_gem" + run: "bundle install" + env: + BUNDLE_GEMFILE: "Gemfile_no_rake" - name: "Compile when target gem doesn't have rake as dependency" working-directory: "test/fixtures/dummy_gem" run: "easy_compile compile" diff --git a/lib/easy_compile/templates/.github/workflows/easy-compile.yaml.tt b/lib/easy_compile/templates/.github/workflows/easy-compile.yaml.tt index aee4ec5..f4fc935 100644 --- a/lib/easy_compile/templates/.github/workflows/easy-compile.yaml.tt +++ b/lib/easy_compile/templates/.github/workflows/easy-compile.yaml.tt @@ -30,7 +30,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "compile" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem <%- if options['working-directory'] -%> working-directory: "<%= options['working-directory'] %>" <%- end -%> @@ -59,7 +58,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "test_${{ matrix.type }}" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem <%- if options['working-directory'] -%> working-directory: "<%= options['working-directory'] %>" <%- end -%> @@ -82,7 +80,6 @@ jobs: - name: "Run easy compile" uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem step: "install" release: permissions: @@ -102,4 +99,3 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "release" - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/test/fixtures/dummy_gem/.gitignore b/test/fixtures/dummy_gem/.gitignore index 69cf799..6bc99e1 100644 --- a/test/fixtures/dummy_gem/.gitignore +++ b/test/fixtures/dummy_gem/.gitignore @@ -1,3 +1,4 @@ Gemfile.lock +Gemfile_no_rake.lock lib/*.bundle tmp/ \ No newline at end of file diff --git a/test/fixtures/dummy_gem/Gemfile_no_rake.lock b/test/fixtures/dummy_gem/Gemfile_no_rake.lock deleted file mode 100644 index f9bb0c5..0000000 --- a/test/fixtures/dummy_gem/Gemfile_no_rake.lock +++ /dev/null @@ -1,20 +0,0 @@ -PATH - remote: . - specs: - edouard-dummy_gem (0.1.10) - -GEM - remote: https://rubygems.org/ - specs: - minitest (5.26.0) - -PLATFORMS - arm64-darwin-24 - ruby - -DEPENDENCIES - edouard-dummy_gem! - minitest - -BUNDLED WITH - 2.7.2 diff --git a/test/fixtures/expected_github_workflow.yml b/test/fixtures/expected_github_workflow.yml index ea89f85..55ee4ba 100644 --- a/test/fixtures/expected_github_workflow.yml +++ b/test/fixtures/expected_github_workflow.yml @@ -27,7 +27,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "compile" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem test: timeout-minutes: 20 name: "Run the test suite" @@ -50,7 +49,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "test_${{ matrix.type }}" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem install: timeout-minutes: 5 name: "Verify the gem can be installed" @@ -67,7 +65,6 @@ jobs: - name: "Run easy compile" uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem step: "install" release: permissions: @@ -87,4 +84,3 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "release" - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/test/fixtures/expected_github_workflow_test_and_workdir.yml b/test/fixtures/expected_github_workflow_test_and_workdir.yml index d0456e5..c82656b 100644 --- a/test/fixtures/expected_github_workflow_test_and_workdir.yml +++ b/test/fixtures/expected_github_workflow_test_and_workdir.yml @@ -28,7 +28,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "compile" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem working-directory: "foo/bar" test: timeout-minutes: 20 @@ -53,7 +52,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "test_${{ matrix.type }}" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem working-directory: "foo/bar" test-command: "bundle exec something" install: @@ -72,7 +70,6 @@ jobs: - name: "Run easy compile" uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem step: "install" release: permissions: @@ -92,4 +89,3 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "release" - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/test/fixtures/expected_github_workflow_test_command.yml b/test/fixtures/expected_github_workflow_test_command.yml index ecf5e40..94dbd7a 100644 --- a/test/fixtures/expected_github_workflow_test_command.yml +++ b/test/fixtures/expected_github_workflow_test_command.yml @@ -27,7 +27,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "compile" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem test: timeout-minutes: 20 name: "Run the test suite" @@ -50,7 +49,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "test_${{ matrix.type }}" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem test-command: "bundle exec something" install: timeout-minutes: 5 @@ -68,7 +66,6 @@ jobs: - name: "Run easy compile" uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem step: "install" release: permissions: @@ -88,4 +85,3 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "release" - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/test/fixtures/expected_github_workflow_working_dir.yml b/test/fixtures/expected_github_workflow_working_dir.yml index b21dfb1..6723794 100644 --- a/test/fixtures/expected_github_workflow_working_dir.yml +++ b/test/fixtures/expected_github_workflow_working_dir.yml @@ -28,7 +28,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "compile" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem working-directory: "test/fixtures/date" test: timeout-minutes: 20 @@ -53,7 +52,6 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "test_${{ matrix.type }}" - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem working-directory: "test/fixtures/date" install: timeout-minutes: 5 @@ -71,7 +69,6 @@ jobs: - name: "Run easy compile" uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: - token: ${{ secrets.EASY_COMPILE }} # TODO Remove this before publishing the gem step: "install" release: permissions: @@ -91,4 +88,3 @@ jobs: uses: "shopify-playground/edouard-playground/.github/actions/easy_compile@main" with: step: "release" - token: ${{ secrets.GITHUB_TOKEN }}