From 04c7b0f6a5a58eac288c721771959b3a2d44829e Mon Sep 17 00:00:00 2001 From: waffle Date: Mon, 24 Jan 2022 17:23:48 +0800 Subject: [PATCH 1/4] ci(test.yml): add CI --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..57cca34 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Test + +on: + push: + # branches: + # - develop + pull_request: + # branches: + # - develop + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.9] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + From 0bc49487b3e510b9f457992d6ba544037f7d1088 Mon Sep 17 00:00:00 2001 From: waffle Date: Mon, 24 Jan 2022 17:26:39 +0800 Subject: [PATCH 2/4] ci(test.yml): add testing --- .github/workflows/test.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 57cca34..8fc2f6c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,5 +24,16 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - + - name: Install dependencies + env: + GITHUB_TOKEN: ${{ secrets.NUMBERS_GITHUB_TOKEN }} + run: | + sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y swig libexiv2-dev libboost-python-dev + python -m pip install --upgrade pip + pip install pytest + python3 -m pip install -e ./pyc2pa + - name: test + env: + GITHUB_TOKEN: ${{ secrets.NUMBERS_GITHUB_TOKEN }} + run: | + pytest \ No newline at end of file From c479c5ec0673cdade6a15add1c450843f67ca38c Mon Sep 17 00:00:00 2001 From: waffle Date: Mon, 24 Jan 2022 17:28:30 +0800 Subject: [PATCH 3/4] ci(test.yml): modify test shell --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fc2f6c..8e2ebdb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,6 @@ jobs: sudo apt-get update && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y swig libexiv2-dev libboost-python-dev python -m pip install --upgrade pip pip install pytest - python3 -m pip install -e ./pyc2pa - name: test env: GITHUB_TOKEN: ${{ secrets.NUMBERS_GITHUB_TOKEN }} From 95ac3067087430d6251a8593f12f50666df31346 Mon Sep 17 00:00:00 2001 From: waffle Date: Mon, 24 Jan 2022 17:30:28 +0800 Subject: [PATCH 4/4] ci(test.yml): trigger on main branch --- .github/workflows/test.yml | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8e2ebdb..91efca0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,11 +5,11 @@ name: Test on: push: - # branches: - # - develop + branches: + - main pull_request: - # branches: - # - develop + branches: + - main jobs: test: @@ -35,4 +35,30 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.NUMBERS_GITHUB_TOKEN }} run: | - pytest \ No newline at end of file + pytest + notification-success: + runs-on: ubuntu-latest + needs: test + + steps: + - uses: actions/checkout@v2 + + - name: Slack Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_COLOR: 'success' + + notification-failure: + runs-on: ubuntu-latest + needs: test + if: ${{ failure() }} + + steps: + - uses: actions/checkout@v2 + + - name: Slack Notification + uses: rtCamp/action-slack-notify@v2 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_COLOR: 'failure' \ No newline at end of file