From 3371d6b95f58da6c2c2f0dc69d0e420b58407c78 Mon Sep 17 00:00:00 2001 From: Ari Date: Wed, 29 Jun 2022 12:20:28 -0400 Subject: [PATCH] updated actions --- .github/workflows/build.yml | 6 +++ .github/workflows/codeql-analysis.yml | 1 + .github/workflows/pr_test.yml | 72 --------------------------- .github/workflows/test.yml | 10 ++++ 4 files changed, 17 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/pr_test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5efb262..4e4ede3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,12 @@ jobs: arch: ["aarch64", "amd64", "armhf", "armv7", "i386"] steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.10.0 + with: + all_but_latest: true + access_token: ${{ github.token }} + - name: Check out repository uses: actions/checkout@v3 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0efd6a3..e6fa102 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -40,6 +40,7 @@ jobs: - name: Cancel Previous Runs uses: styfle/cancel-workflow-action@0.10.0 with: + all_but_latest: true access_token: ${{ github.token }} - name: Checkout repository diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml deleted file mode 100644 index 9c81602..0000000 --- a/.github/workflows/pr_test.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: PR Tests -on: - pull_request: - branches: - - main -jobs: - metadata: - runs-on: ubuntu-latest - name: Metadata - outputs: - version: ${{ steps.version.outputs.VERSION }} - steps: - - name: Check out repository - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Get Version - id: version - shell: bash - run: | - echo ::set-output name=VERSION::$(git describe --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g') - - name: ${{ steps.version.outputs.VERSION }} - shell: bash - run: | - echo ${{ steps.version.outputs.VERSION }} - - python: - name: "Python Tests" - runs-on: ubuntu-latest - needs: - - metadata - strategy: - matrix: - action: - - lint - - coverage - - security-checks - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Install Dependencies - run: cd api && make setup - - name: Echo dependencies - run: cd api && ./venv/bin/pip freeze - - name: ${{ needs.metadata.outputs.version }} / ${{ matrix.action }} - run: cd api && make ${{ matrix.action }} - - nodejs: - name: "NodeJs Tests" - runs-on: ubuntu-latest - needs: - - metadata - strategy: - matrix: - action: - - "test:ci" - - "build" - - "tsc:ci" - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - cache: "yarn" - cache-dependency-path: webapp/yarn.lock - - name: Install Dependencies - run: cd webapp && yarn install - - name: ${{ needs.metadata.outputs.version }} / ${{ matrix.action }} - run: cd webapp && yarn ${{ matrix.action }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 617cff9..36bcac1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,9 @@ on: push: branch: - main + pull_request: + branch: + - main jobs: metadata: runs-on: ubuntu-latest @@ -73,6 +76,7 @@ jobs: deploy: runs-on: ubuntu-latest name: Build & Publish ${{ matrix.arch }} + if: github.event_name != 'pull_request' needs: - metadata - nodejs @@ -82,6 +86,12 @@ jobs: arch: ["aarch64", "amd64", "armhf", "armv7", "i386"] steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.10.0 + with: + all_but_latest: true + access_token: ${{ github.token }} + - name: Check out repository uses: actions/checkout@v3