Skip to content

ci: abandon v1 release support in end-to-end tests #1241

ci: abandon v1 release support in end-to-end tests

ci: abandon v1 release support in end-to-end tests #1241

Workflow file for this run

name: CI workflow
on: [push, pull_request, workflow_dispatch]
permissions:
checks: write
issues: write
contents: write
jobs:
pre-commit:
name: Run pre-commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v2.0.3
tests:
name: Jest tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install nektos/act
run: curl https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash -s -- -b /usr/local/bin/ v0.2.20
- uses: actions/setup-node@v3
with:
node-version: 14
- run: npm install
- name: Run Jest tests
run: npm test
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Upload coverage information
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage/
sonarcloud:
runs-on: ubuntu-latest
name: SonarCloud
needs: [tests]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download coverage information
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage/
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
e2e-default:
name: End-to-end tests - default
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
id: aws-credentials
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ca-central-1
- name: Invoke "taskcat test run"
uses: ./
with:
commands: test run --lint-disable --project-root ./e2e/resources/default
e2e-update:
name: End-to-end tests - update taskcat
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ca-central-1
- name: Invoke "taskcat test run"
uses: ./
with:
commands: test run --lint-disable --project-root ./e2e/resources/default
update_taskcat: true
e2e-lint-update:
name: End-to-end tests - update taskcat
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ca-central-1
- name: Invoke "taskcat test run"
uses: ./
with:
commands: test run --lint-disable --project-root ./e2e/resources/default
update_taskcat: true
update_cfn_lint: true
vale:
name: Run Vale
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: errata-ai/vale-action@v2.1.1
with:
debug: true
files: '[ "README.md", "vale/README.md", "src/", "e2e/", "docs/", "__tests__/" ]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create release
runs-on: ubuntu-latest
needs: [pre-commit, tests, e2e-default, e2e-update, e2e-lint-update, vale]
if: ${{ needs.pre-commit.result == 'success' && needs.tests.result == 'success' && needs.e2e-default.result == 'success' && needs.e2e-update.result == 'success' && needs.e2e-lint-update.result == 'success' && needs.vale.result == 'success' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 21
- name: Release
uses: cycjimmy/semantic-release-action@v4.1.1
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update v1 branch reference
if: steps.semantic.outputs.new_release_published == 'true'
run: "git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}