Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(action): no need to checkout #82

Merged
merged 2 commits into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 26 additions & 20 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,60 +22,66 @@ outputs:
matrix_output:
description: "Uploaded matrix artifact name"
value: ${{ steps.store-outputs.outputs.matrix }}

runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: falcosecurity/kernel-testing
ref: ${{ env.ACTION_REF }}
# If action_ref points to v0 or v0.3, expect to be on a tag,
# else expect that user passed either `main` or an hash.
- name: Fetch tag or hash to be used
shell: bash
working-directory: ${{ github.action_path }}
id: git
run: |
if [[ "$ACTION_REF" =~ ^v[0-9] ]]; then
GIT_VER=$(git tag --points-at HEAD)
else
GIT_VER=$ACTION_REF
fi
echo "git_ver=$GIT_VER" >> $GITHUB_OUTPUT
env:
ACTION_REF: ${{ github.action_ref }}
ACTION_REF: ${{ github.action_ref }}

- name: Generate vars yaml
working-directory: ./ansible-playbooks
working-directory: ${{ github.action_path }}/ansible-playbooks
shell: bash
run: |
cat > vars.yml <<EOF
run_id: "id-${{ github.run_id }}"
output_dir: "~/ansible_output_${{ github.run_id }}"
tag: "${ACTION_REF}"
tag: "${{ steps.git.outputs.git_ver }}"
repos:
libs: {name: "falcosecurity-libs", repo: "https://github.com/${{ inputs.libsrepo }}.git", version: "${{ inputs.libsversion }}"}
EOF
env:
ACTION_REF: ${{ github.action_ref }}


- name: Bootstrap VMs
working-directory: ./ansible-playbooks
working-directory: ${{ github.action_path }}/ansible-playbooks
shell: bash
run: ansible-playbook bootstrap.yml --extra-vars "@vars.yml"

- name: Common setup
working-directory: ./ansible-playbooks
working-directory: ${{ github.action_path }}/ansible-playbooks
shell: bash
run: ansible-playbook common.yml --extra-vars "@vars.yml"

- name: Prepare github repos
working-directory: ./ansible-playbooks
working-directory: ${{ github.action_path }}/ansible-playbooks
shell: bash
run: ansible-playbook git-repos.yml --extra-vars "@vars.yml"

- name: Run scap-open tests
working-directory: ./ansible-playbooks
working-directory: ${{ github.action_path }}/ansible-playbooks
shell: bash
run: |
ansible-playbook scap-open.yml --extra-vars "@vars.yml" || :

- name: Tar output files
shell: bash
run: tar -cvf ansible_output.tar ~/ansible_output_${{ github.run_id }}
run: tar -cvf $GITHUB_ACTION_PATH/ansible_output.tar ~/ansible_output_${{ github.run_id }}

- name: Build matrix_gen and generate matrix
if: inputs.build_matrix == 'true'
working-directory: ./matrix_gen
working-directory: ${{ github.action_path }}/matrix_gen
env:
GOPATH: /root/go
GOCACHE: /root/.cache/go-build
Expand All @@ -93,7 +99,7 @@ runs:

- name: Cleanup
if: always()
working-directory: ./ansible-playbooks
working-directory: ${{ github.action_path }}/ansible-playbooks
shell: bash
run: |
ansible-playbook clean-up.yml --extra-vars "@vars.yml" || :
Loading