diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 50f0c5b6..8703e48a 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -11,8 +11,12 @@ blocks: jobs: - name: bundle commands: - - sem-version ruby 2.7.3 + - '#sem-version ruby 2.7.3' + - sem-version ruby 3.1.0 + - ruby -v - sem-version node 14.16.1 + - echo "changed back" + - echo $SEMAPHORE_GIT_URL - checkout - cache restore - bundle install @@ -24,7 +28,9 @@ blocks: jobs: - name: check style + security commands: - - sem-version ruby 2.7.3 + - '#sem-version ruby 2.7.3' + - sem-version ruby 3.1.0 + - ruby -v - sem-version node 14.16.1 - checkout - cache restore @@ -38,7 +44,9 @@ blocks: task: prologue: commands: - - sem-version ruby 2.7.3 + - '#sem-version ruby 2.7.3' + - sem-version ruby 3.1.0 + - ruby -v - sem-version node 14.16.1 - checkout - cache restore @@ -50,20 +58,37 @@ blocks: - name: RSpec - model tests commands: - bundle exec rspec spec/models + - test-results compile --name "First report results" junit.xml report1.json + - '# Manualy create the second report' + - test-results compile --name "Second report results" junit.xml report2.json + - '# Combine two reports together' + - test-results combine report1.json report2.json report.json + - '# Push report to artifact storage' + - artifact push job report.json -d test-results/junit.json - name: RSpec - controller tests commands: - bundle exec rspec spec/controllers + - test-results compile --name "First report" junit.xml report1.json + - '# Manualy create the second report' + - test-results compile --name "Second report" junit.xml report2.json + - '# Combine two reports together' + - test-results combine report1.json report2.json report.json + - '# Push report to artifact storage' + - artifact push job report.json -d test-results/junit2.json epilogue: always: commands: - - test-results publish junit.xml + - '#test-results publish --name "teste-vaisalvardiferente" junit.xml' + - '#test-results publish --name "tentar outro" junit.xml' - name: Integration tests dependencies: - Unit tests task: prologue: commands: - - sem-version ruby 2.7.3 + - '#sem-version ruby 2.7.3' + - sem-version ruby 3.1.0 + - ruby -v - sem-version node 14.16.1 - checkout - cache restore @@ -78,4 +103,10 @@ blocks: epilogue: always: commands: - - test-results publish junit.xml \ No newline at end of file + - test-results publish junit.xml +after_pipeline: + task: + jobs: + - name: Reports + commands: + - test-results gen-pipeline-report diff --git a/README.md b/README.md index 78e561f1..8c0a500c 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ You can follow along with this project by reading the [documentation](https://docs.semaphoreci.com/article/99-rails-continuous-integration). Or jump straight into `.semaphore/semaphore.yml`. +This project also makes use of the Test Results feature. + You can extend the CI pipeline with Continuous Delivery by implementing a [promotion](https://docs.semaphoreci.com/article/67-deploying-with-promotions). Refer to Semaphore documentation for additional deployment examples. diff --git a/dummy_to_run_tests.txt b/dummy_to_run_tests.txt new file mode 100644 index 00000000..cb44a0e6 --- /dev/null +++ b/dummy_to_run_tests.txt @@ -0,0 +1 @@ +yep exactly