More self hosted testing #45
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: Actions Workflow | |
on: | |
repository_dispatch: | |
types: [ Dispatch ] | |
push: | |
branches: | |
- main | |
# - 'dev' | |
# - '!feature/**' | |
tags: | |
- 'v**' | |
- '!v1.0' | |
# # Careful or wont trigger at all | |
# paths: | |
# - '**.py' | |
# - .github/** | |
# - '!docs/**' | |
# - '!test.js' | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- reopened | |
# schedule: | |
# - cron: "15 14 * * *" | |
# - cron: "15 21 * * *" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
jobs: | |
run-github-actions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: List Things | |
id: list-things | |
run: | | |
pwd | |
ls | |
echo ${GITHUB_SHA} | |
echo ${GITHUB_SHA::8} | |
echo ${GITHUB_REF} | |
echo ${GITHUB_REPOSITORY} | |
echo ${GITHUB_WORKSPACE} | |
- name: Dispatch Output | |
id: Dispatch_Output | |
run: 'echo "field: ${{ github.event.client_payload.version }}"' | |
- name: Simple JS actions | |
id: greet | |
uses: actions/hello-world-javascript-action@main | |
with: | |
who-to-greet: 'Mona the Octocat' | |
- name: Log Greeting | |
run: echo "${{ steps.greet.outputs.time }}" | |
# 1. Multi lint jobs like this | |
- name: failure | |
id: failure | |
if: github.ref == 'refs/heads/main' | |
continue-on-error: true | |
run: | | |
echo "Error!" 1>&2 | |
exit 64 | |
# add another step here pringing the output of above | |
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#steps-context | |
- name: failure outcome debug | |
run: | | |
echo '${{ steps.failure.outcome }}' | |
echo '${{ steps.failure.conclusion }}' | |
- name: Failure notification | |
uses: act10ns/slack@v1 | |
with: | |
status: ${{ job.status }} | |
steps: ${{ toJson(steps) }} | |
channel: '#githubactions_notifications' | |
if: cancelled() || failure() | |
#if: always() | |
- name: Failure notification if failed | |
uses: act10ns/slack@v1 | |
with: | |
status: ${{ job.status }} | |
steps: ${{ toJson(steps) }} | |
channel: '#githubactions_notifications' | |
if: steps.failure.outcome == 'failure' | |
#if: always() | |
multi-os: | |
needs: run-github-actions | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-20.04 ] | |
# os: [ ubuntu-20.04, ubuntu-18.04, ubuntu-16.04 ] | |
# os: [ windows-latest, ubuntu-latest, macos-latest ] | |
steps: | |
- name: test all shells | |
id: test-shells | |
run: echo 'Hello World' | |
- name: OS version | |
id: os-version | |
run: | | |
cat /etc/os-release | |
- name: Failure Notification | |
uses: act10ns/slack@v1 | |
with: | |
status: ${{ job.status }} | |
steps: ${{ toJson(steps) }} | |
channel: '#githubactions_notifications' | |
if: cancelled() || failure() | |
#if: always() |