add find-issue-comment #68
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: Testing custom actions | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
test-setup-ssh: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Setup ssh key and known_hosts | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/setup-ssh@feature/add-render-jinja2-action | |
with: | |
ssh-key: ${{ secrets.SA_GITHUB_SSH_KEY }} | |
known-hosts: github.com | |
- name: Check ssh key | |
run: | | |
ssh -T [email protected] || test $? = 1 | |
test-setup-ssh-in-container: | |
runs-on: ubuntu-22.04 | |
container: ghcr.io/everest/everest-ci-env:latest | |
steps: | |
- name: Setup ssh key and known_hosts | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/setup-ssh@feature/add-render-jinja2-action | |
with: | |
ssh-key: ${{ secrets.SA_GITHUB_SSH_KEY }} | |
known-hosts: github.com | |
home-directory: /root | |
- name: Check ssh key | |
run: | | |
ssh -T [email protected] || test $? = 1 | |
test-render-jinja2: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Create simple template with variable | |
run: | | |
echo "Hello {{ name }}" > template.j2 | |
- name: Create data file | |
run: | | |
echo "name: world" > data.yaml | |
- name: Render template | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/render-jinja2@feature/add-render-jinja2-action | |
with: | |
template_file: template.j2 | |
data_file: data.yaml | |
output_file: output.txt | |
- name: Check output | |
run: | | |
cat output.txt | |
test "$(cat output.txt)" = "Hello world" | |
test-pull-single-file-1: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Create simple template with variable | |
run: | | |
echo "Hello {{ name }}" > template.j2 | |
- name: Create data file | |
run: | | |
echo "name: world" > data.yaml | |
- name: Render template | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/render-jinja2@feature/add-render-jinja2-action | |
with: | |
template_file: template.j2 | |
data_file: data.yaml | |
output_file: output.txt | |
- name: Check output | |
run: | | |
cat output.txt | |
test "$(cat output.txt)" = "Hello world" | |
test-pull-single-file-2: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Setup SSH | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/setup-ssh@feature/add-render-jinja2-action | |
with: | |
ssh-key: ${{ secrets.SA_GITHUB_SSH_KEY }} | |
- name: Pull single file from a repository | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/pull-single-file@feature/add-render-jinja2-action | |
id: pull-single-file | |
with: | |
# LTODO: switch to main branch | |
github_path: everest/everest-ci/.github/workflows/test-github-actions.yaml@feature/add-render-jinja2-action | |
output_path: . | |
- name: Checkout everest-ci | |
uses: actions/checkout@v2 | |
with: | |
repository: everest/everest-ci | |
# LTODO: switch to main branch | |
ref: ${{ github.ref }} | |
path: everest-ci | |
- name: Check all outputs | |
run: | | |
echo "input_owner: ${{ steps.pull-single-file.outputs.input_owner }}" | |
test "${{ steps.pull-single-file.outputs.input_owner }}" = "everest" | |
echo "input_repo: ${{ steps.pull-single-file.outputs.input_repo }}" | |
test "${{ steps.pull-single-file.outputs.input_repo }}" = "everest-ci" | |
echo "input_ref: ${{ steps.pull-single-file.outputs.input_ref }}" | |
# LTODO: Switch to main branch | |
test "${{ steps.pull-single-file.outputs.input_ref }}" = "feature/add-render-jinja2-action" | |
echo "input_filename: ${{ steps.pull-single-file.outputs.input_filename }}" | |
test "${{ steps.pull-single-file.outputs.input_filename }}" = "test-github-actions.yaml" | |
echo "input_directory: ${{ steps.pull-single-file.outputs.input_directory }}" | |
test "${{ steps.pull-single-file.outputs.input_directory }}" = ".github/workflows" | |
echo "output_directory: ${{ steps.pull-single-file.outputs.output_directory }}" | |
test "${{ steps.pull-single-file.outputs.output_directory }}" = "$(pwd)" | |
echo "output_filename: ${{ steps.pull-single-file.outputs.output_filename }}" | |
test "${{ steps.pull-single-file.outputs.output_filename }}" = "test-github-actions.yaml" | |
- name: Check output file | |
run: | | |
cat ${{ steps.pull-single-file.outputs.output_filename }} | |
test "$(cat ${{ steps.pull-single-file.outputs.output_filename }})" = "$(cat everest-ci/.github/workflows/test-github-actions.yaml)" | |
test-configure-git: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Configure Git | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/configure-git@feature/add-render-jinja2-action | |
with: | |
email: [email protected] | |
name: Github Service Account | |
- name: Test | |
run: | | |
git config --list --global | |
test "$(git config --get user.email)" = "[email protected]" | |
test "$(git config --get user.name)" = "Github Service Account" | |
test-find-issue-comment: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Find issue comment | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/find-issue-comment@feature/add-render-jinja2-action | |
id: find-issue-comment | |
with: | |
owner: everest | |
repo: everest | |
token: ${{ secrets.SA_GITHUB_PAT }} | |
issue_number: 98 | |
user: pionix-compiler | |
test-update-issue-comment: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Find issue comment | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/find-issue-comment@feature/add-render-jinja2-action | |
id: find-issue-comment | |
with: | |
owner: everest | |
repo: everest | |
token: ${{ secrets.SA_GITHUB_PAT }} | |
issue_number: 98 | |
user: pionix-compiler | |
- name: Update issue comment | |
# LTODO: switch to main branch | |
uses: everest/everest-ci/github-actions/update-issue-comment@feature/add-render-jinja2-action | |
with: | |
owner: everest | |
repo: everest | |
token: ${{ secrets.SA_GITHUB_PAT }} | |
comment_id: ${{ steps.find-issue-comment.outputs.comment_id }} | |
body: "Hello World 2" | |
# test-create-issue-comment: | |
# runs-on: ubuntu-22.04 | |
# steps: | |
# - name: Create issue comment | |
# # LTODO: switch to main branch | |
# uses: everest/everest-ci/github-actions/create-issue-comment@feature/add-render-jinja2-action | |
# id: create-issue-comment | |
# with: | |
# owner: everest | |
# repo: everest | |
# token: ${{ secrets.SA_GITHUB_PAT }} | |
# issue_number: 98 | |
# body: "Hello World" |