Skip to content

feat(e2e): migrate off circleci #6322

feat(e2e): migrate off circleci

feat(e2e): migrate off circleci #6322

Workflow file for this run

name: tester
on:
push:
branches:
- 'main'
- 'release-**'
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- 'main'
- 'release-**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
changes:
outputs:
should-run-tests: ${{ steps.changes.outputs.go == 'true' }}
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: changes
with:
filters: |
go:
- '**.go'
- '**.txt' # golden file test output
- 'go.*'
- '.github/workflows/test.yml'
test:
needs: [changes]
if: needs.changes.outputs.should-run-tests == 'true'
name: Tests
runs-on: ubuntu-22.04
container: ghcr.io/runatlantis/testing-env:latest@sha256:346fd2028603d7c9369f709023ef993faf60a70ef4c91963f5baa7454196df32
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
# need to setup go toolchain explicitly
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
with:
go-version-file: go.mod
- run: make test-all
- run: make check-fmt
###########################################################
# Notifying #contributors about test failure on main branch
###########################################################
- name: Slack failure notification
if: ${{ github.ref == 'refs/heads/main' && failure() }}
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":x: Failed GitHub Action:"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Workflow:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}>"
},
{
"type": "mrkdwn",
"text": "*Job:*\n${{ github.job }}"
},
{
"type": "mrkdwn",
"text": "*Repo:*\n${{ github.repository }}"
}
]
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
skip-test:
needs: [changes]
if: needs.changes.outputs.should-run-tests == 'false'
name: Tests
runs-on: ubuntu-22.04
steps:
- run: 'echo "No build required"'
e2e:
runs-on: ubuntu-latest
# dont run e2e tests on forked PRs
if: github.repository == 'runatlantis/atlantis'
env:
TERRAFORM_VERSION: 1.8.3
GITHUB_USERNAME: ${{ secrets.ATLANTISBOT_GITHUB_USERNAME }}
GITHUB_PASSWORD: ${{ secrets.ATLANTISBOT_GITHUB_PASSWORD }}
NGROK_AUTH_TOKEN: ${{ secrets.ATLANTISBOT_NGROK_AUTH_TOKEN }}
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5
with:
go-version-file: go.mod
# This version of TF will be downloaded before Atlantis is started.
# We do this instead of setting --default-tf-version because setting
# that flag starts the download asynchronously so we'd have a race
# condition.
- uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # v3
with:
terraform_version: 1.8.3
- name: Setup deps
run: |
wget -q -nc https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz
tar -xzf ngrok-v3-stable-linux-amd64.tgz && \
chmod +x ngrok
./ngrok --help
- name: Setup gitconfig
run: |
git config --global user.email "[email protected]"
git config --global user.name "atlantisbot"
- run: |
make build-service
./scripts/e2e.sh