Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
feat: try with catche
Browse files Browse the repository at this point in the history
  • Loading branch information
ASuciuX committed Dec 1, 2023
1 parent c1cc28c commit 8b8cc79
Showing 1 changed file with 54 additions and 38 deletions.
92 changes: 54 additions & 38 deletions .github/workflows/mutants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,22 @@ jobs:
# - 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

# # Upload stable output version
# stable-mutants:
# name: Upload Stable Mutants Testing
Expand Down Expand Up @@ -78,47 +94,47 @@ jobs:
# 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
# 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: 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: 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
# - 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
# - 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: 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
# - name: Archive mutants output
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: mutants-stable-develop
# path: mutation-testing/packages-output

0 comments on commit 8b8cc79

Please sign in to comment.