Skip to content

Commit

Permalink
Feature: Init GitHub actions
Browse files Browse the repository at this point in the history
- Added build job;
- Adjust push rule;
  • Loading branch information
OleksiiBulba committed Sep 4, 2022
1 parent 5278949 commit 85ea2ed
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 33 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Main Ci/CD
on:
push:
branches-ignore:
- master
- develop
jobs:
tests:
runs-on: ubuntu-latest
steps:
- run: |
echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
echo "🔎 The name of branch is ${{ github.ref }} and repository is ${{ github.repository }}."
- name: Checkout
uses: actions/checkout@v3
- run: |
echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
echo "🖥️ The workflow is now ready to test code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: Run tests
run: |
cd ${{ github.workspace }}/tests/install && ${{ github.workspace }}/tests/run-test-install.sh -c
- run: echo "🍏 This job's status is ${{ job.status }}."
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: lint
uses: luke142367/[email protected]
with:
target: src/build/php/Dockerfile
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/[email protected]
id: pr
with:
github-token: ${{env.BOT_USER_TOKEN}}
result-encoding: string
script: |
const result = await github.repos.listPullRequestsAssociatedWithCommit({
owner: context.payload.repository.owner.name,
repo: context.payload.repository.name,
commit_sha: context.payload.head_commit.id
})
return result.data[0].number;
- name: Get changed files
id: get_file_changes
uses: trilom/[email protected]
with:
githubToken: ${{ env.BOT_USER_TOKEN }}
prNumber: ${{ steps.pr.outputs.results }}
output: ' '
fileOutput: ' '
- name: Echo file changes
run: |
echo Changed files: ${{ steps.get_file_changes.outputs.files }}
cat $HOME/files.json
cat $HOME/files_modified.json
cat $HOME/files_added.json
cat $HOME/files_removed.json
echo '${{ steps.file_changes.outputs.files}}'
echo '${{ steps.file_changes.outputs.files_modified}}'
echo '${{ steps.file_changes.outputs.files_added}}'
echo '${{ steps.file_changes.outputs.files_removed}}'
33 changes: 0 additions & 33 deletions .github/workflows/main.yaml

This file was deleted.

0 comments on commit 85ea2ed

Please sign in to comment.