Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .github/workflows/ci.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/lint.yaml

This file was deleted.

26 changes: 18 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Google LLC
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -11,14 +11,24 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Lint
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]

jobs:
lint:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.head_ref || github.ref }}
cancel-in-progress: true
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: |
echo "No lint checks";
exit 1;
- uses: actions/checkout@v3.0.0
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- uses: github/super-linter/slim@v4.9.0
env:
ERROR_ON_MISSING_EXEC_BIT: true
VALIDATE_JSCPD: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62 changes: 43 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Test
on: [push, pull_request]

on: [push, pull_request, workflow_dispatch]

jobs:
matrix:
concurrency:
group: ${{ github.head_ref || github.ref }}
cancel-in-progress: true
# Only run for internal PRs or after a merge
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
runs-on: ubuntu-latest
strategy:
matrix:
# TODO - expand matrix once stable
python-version: [3.6]
steps:
- uses: actions/checkout@v3
- name: Fetch and Diff PR with base from which it was cloned
if: ${{ github.event.pull_request.base.sha }}
run: |
git fetch origin master "${{ github.event.pull_request.base.sha }}"
git diff --diff-filter=ACM --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" > "${HOME}/changed_files.txt"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
- name: Write test credentials
run: |
mkdir "${HOME}/secrets"
echo "${DEFAULT_CREDENTIALS}" > "${HOME}/secrets/default_credentials.json"
echo "${SERVICE_ACCOUNT_CREDENTIALS}" > "${HOME}/secrets/service_account.json"
echo "${CLIENT_ID_FILE}" > "${HOME}/secrets/client_id.json"
env:
DEFAULT_CREDENTIALS: ${{secrets.SNIPPETS_DEFAULT_CREDENTIALS}}
SERVICE_ACCOUNT_CREDENTIALS: ${{secrets.SNIPPETS_DELEGATED_ADMIN_SERVICE_ACCOUNT}}
CLIENT_ID_FILE: ${{secrets.SNIPPETS_CLIENT_ID_FILE}}
- name: Run tests
run: ./.github/scripts/test.sh
test:
needs: [matrix]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
echo "No tests";
exit 1;
- run: echo "Test matrix finished"