Skip to content

Remove pynguin, cache java projects separately due to size, reduce ma… #25

Remove pynguin, cache java projects separately due to size, reduce ma…

Remove pynguin, cache java projects separately due to size, reduce ma… #25

name: Update slices
on:
workflow_dispatch:
inputs:
commit-updates:
description: Push updated slices
required: false
default: true
type: boolean
commit-msg:
description: Commit message
required: false
default: "Slice update"
type: string
filter-slice-type:
description: Generate only this slice type
required: false
type: string
filter:
description: Generate only for these languages (separated by spaces)
required: false
default: 'java javascript python'
type: string
debug-cmds:
description: Don't execute commands, just print and output shell files
required: false
type: boolean
default: false
custom-csv:
description: Link to custom sources.csv (Input accepted from Caroline or Prabhu only)
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-${{ inputs.filter }}-${{ inputs.filter-slice-type }}
cancel-in-progress: true
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install -g @appthreat/atom
- name: sdkman install
run: |
curl -s "https://get.sdkman.io" | bash
source "/home/runner/.sdkman/bin/sdkman-init.sh"
echo sdkman_auto_answer=true > ~/.sdkman/etc/config
- name: Allow a custom csv
if: inputs.custom-csv != '' && (github.actor == 'cerrussell' || github.actor == 'prabhu')
run: |
curl -o sources.csv ${{ inputs.custom-csv }}

Check failure on line 58 in .github/workflows/generate_samples.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/generate_samples.yml

Invalid workflow file

You have an error in your yaml syntax on line 58
- name: Sample repo cache (python and javascript)
if: 'python' in inputs.filter || 'javascript' in inputs.filter
uses: actions/cache@v3
id: cache
with:
path: |
/home/runner/work/src_repos/python
/home/runner/work/src_repos/javascript
key: ${{ runner.os }}-python-js-sample-repos-${{ hashFiles('sources.csv') }}
- name: Sample repo cache (java)
if: 'java' in inputs.filter
uses: actions/cache@v3
id: cache
with:
path: /home/runner/work/src_repos/java
key: ${{ runner.os }}-java-sample-repos-${{ hashFiles('sources.csv') }}
- name: sdkman install cache
uses: actions/cache@v3
id: sdkman-cache
with:
path: /home/runner/.sdkman/candidates
key: ${{ runner.os }}-sdkman-${{ hashFiles('sources.csv') }}
- name: Generate slices
if: ${{ ! inputs.debug-cmds }}
env:
SDKMAN_DIR: /home/runner/.sdkman
run: |
python generate.py -s ${{ inputs.filter-slice-type }} -i ${{ inputs.filter }}
bash /home/runner/work/atom-samples/atom-samples/sdkman_installs.sh
bash /home/runner/work/atom-samples/atom-samples/atom_commands.sh
python generate.py --cleanup
- name: Generate shell scripts only
if: ${{ inputs.debug-cmds }}
run: |
python generate.py --skip-clone --debug-cmds -s ${{ inputs.filter-slice-type }} -i ${{ inputs.filter }}
- name: Upload slices as artifact
uses: actions/upload-artifact@v3
with:
name: slices
path: /home/runner/work/atom-samples/atom-samples/**/*.json
- name: Upload shell scripts generated as artifact
uses: actions/upload-artifact@v3
with:
name: scripts
path: /home/runner/work/atom-samples/atom-samples/*.sh
- name: Commit changes
if: inputs.commit-updates && ${{ ! inputs.debug-cmds }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "Caroline Russell"
git config user.email "caroline@appthreat.dev"
git add ${{ inputs.filter }}
git commit -m "${{ inputs.commit-msg }}"
git push