This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
feat: append 2 simple lines to check overwrite cache #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mutants | |
# to be tried cache vs artifacts | |
# only run on push in order to update the artifact output | |
# flow: | |
# download artifact | |
# run sh script for cargo mutants diff | |
# upload artifact | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
- next | |
- deployer/testing-shell-script | |
jobs: | |
# cache_mutants: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout the latest code | |
# id: git_checkout | |
# uses: actions/checkout@v3 | |
# - name: Cache mutants-initial folder | |
# uses: actions/cache@v3 | |
# with: | |
# path: mutants-initial | |
# key: mutants-initial | |
# - name: Print caught mutants | |
# run: cat mutants-initial/caught.txt | |
# - name: Print missed mutants | |
# run: cat mutants-initial/missed.txt | |
# - name: Print unviable mutants | |
# run: cat mutants-initial/unviable.txt | |
# - name: Print timeout mutants | |
# run: cat mutants-initial/timeout.txt | |
# Upload cache stable output version | |
# cache_mutants_output: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout the latest code | |
# id: git_checkout | |
# uses: actions/checkout@v3 | |
# - name: Cache mutants-initial folder | |
# uses: actions/cache@v3 | |
# with: | |
# path: mutation-testing/packages-output | |
# key: mutants-stable-develop | |
# # - name: Print caught mutants | |
# # run: cat mutants-initial/caught.txt | |
# ## Mutants testing: Execute on push on packages that have tested functions modified | |
cache_update_output: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the latest code | |
id: git_checkout | |
uses: actions/checkout@v3 | |
- name: Restore mutants-output cached folder | |
uses: actions/cache/restore@v3 | |
with: | |
path: mutation-testing/packages-output | |
key: mutants-stable-develop | |
- name: Print caught mutants | |
run: cat mutation-testing/packages-output/pox-locking/missed.txt | |
- run: cargo install cargo-mutants | |
# - name: Update stable mutants with modified functions | |
# run: ./git-diff.sh | |
# working-directory: mutation-testing/scripts | |
# - name: Print updated missed mutants | |
# run: cat mutation-testing/packages-output/pox-locking/missed.txt | |
- name: Append 2 line to one file | |
run: | | |
echo "text 1" >> missed.txt | |
echo "text 2" >> missed.txt | |
working-directory: mutation-testing/packages-output/pox-locking | |
- name: Cache mutants-initial folder | |
uses: actions/cache/save@v3 | |
with: | |
path: mutation-testing/packages-output | |
key: mutants-stable-develop | |
# # Upload stable output version | |
# stable-mutants: | |
# name: Upload Stable Mutants Testing | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# with: | |
# fetch-depth: 0 # do we want to fetch all? | |
# - name: Archive mutants output | |
# uses: actions/upload-artifact@v3 | |
# if: always() | |
# with: | |
# name: mutants-stable-develop | |
# path: mutation-testing/packages-output | |
# ## Mutants testing: Execute on PR on packages that have tested functions modified | |
# ### download it && see how it is | |
# incremental-mutants: | |
# name: Incremental Mutants Testing | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Download stable output artifact | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: mutants-stable-develop | |
# path: mutation-testing/packages-output | |
# - name: Display structure of downloaded files | |
# run: ls -R | |
# working-directory: mutation-testing/packages-output | |
# - run: cargo install cargo-mutants | |
# - name: Update stable mutants with modified functions | |
# run: ./git-diff.sh | |
# working-directory: mutation-testing/scripts | |
# - name: Archive mutants output | |
# uses: actions/upload-artifact@v3 | |
# if: always() | |
# with: | |
# name: mutants-stable-develop | |
# path: mutation-testing/packages-output | |
# incremental-mutants-2: | |
# name: Incremental Mutants Testing | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - name: Check for the existence of the stable output artifact | |
# id: check-artifact | |
# uses: actions/github-script@v5 | |
# with: | |
# script: | | |
# const artifacts = await github.rest.actions.listWorkflowRunArtifacts({ | |
# owner: context.repo.owner, | |
# repo: context.repo.repo, | |
# run_id: context.runId, | |
# }); | |
# const artifactExists = artifacts.data.artifacts.some(artifact => artifact.name === 'mutants-stable-develop'); | |
# core.setOutput('exists', artifactExists); | |
# - name: Download stable output artifact | |
# if: steps.check-artifact.outputs.exists == 'true' | |
# uses: actions/download-artifact@v3 | |
# with: | |
# name: mutants-stable-develop | |
# path: mutation-testing/packages-output | |
# - name: Display structure of downloaded files | |
# if: steps.check-artifact.outputs.exists == 'true' | |
# run: ls -R | |
# working-directory: mutation-testing/packages-output | |
# - run: cargo install cargo-mutants | |
# - name: Update stable mutants with modified functions | |
# if: steps.check-artifact.outputs.exists == 'true' | |
# run: ./git-diff.sh | |
# working-directory: mutation-testing/scripts | |
# - name: Archive mutants output | |
# uses: actions/upload-artifact@v3 | |
# if: always() | |
# with: | |
# name: mutants-stable-develop | |
# path: mutation-testing/packages-output |