Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump GitHub Actions #1687

Closed
wants to merge 3 commits into from
Closed
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
26 changes: 13 additions & 13 deletions .action_templates/e2e-fork-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ jobs:
# dependabot gets a read only github token, and so must use pull_request_target instead of pull_request.
if: contains(github.event.pull_request.labels.*.name, 'dependencies') || contains(github.event.pull_request.labels.*.name, 'safe-to-test')
steps:
- template: cancel-previous
- template: checkout-fork
- template: setup-and-install-python
- template: quay-login
- template: set-up-qemu
# - template: cancel-previous
# - template: checkout-fork
# - template: setup-and-install-python
# - template: quay-login
# - template: set-up-qemu
- template: build-and-push-development-images
- template: tests
steps:
- template: cancel-previous
- template: checkout-fork
- template: set-run-status
- template: setup-and-install-python
- template: setup-kind-cluster
if: steps.last_run_status.outputs.last_run_status != 'success'
- template: run-test-matrix
# - template: cancel-previous
# - template: checkout-fork
# - template: set-run-status
# - template: setup-and-install-python
# - template: setup-kind-cluster
# if: steps.last_run_status.outputs.last_run_status != 'success'
# - template: run-test-matrix
- template: save-run-status
- template: dump-and-upload-diagnostics
# - template: dump-and-upload-diagnostics

events:
- template: pull-request-target
4 changes: 2 additions & 2 deletions .action_templates/e2e-pr-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ jobs:
# run on master, or if a PR is being created from a branch, or if it has been manually triggered.
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
steps:
- template: cancel-previous
# - template: cancel-previous
- template: checkout
- template: setup-and-install-python
- template: quay-login
- template: set-up-qemu
- template: build-and-push-development-images
- template: tests
steps:
- template: cancel-previous
# - template: cancel-previous
- template: checkout
- template: set-run-status
- template: setup-and-install-python
Expand Down
2 changes: 1 addition & 1 deletion .action_templates/steps/cancel-previous.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc # 0.9.0
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
2 changes: 1 addition & 1 deletion .action_templates/steps/checkout-fork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Because we are using pull_request_target the Github Secrets will be passed
# So code should be reviewed before labeling as "safe-to-test"
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{github.event.pull_request.head.sha}}
repository: ${{github.event.pull_request.head.repo.full_name}}
Expand Down
2 changes: 1 addition & 1 deletion .action_templates/steps/checkout.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true
2 changes: 1 addition & 1 deletion .action_templates/steps/quay-login.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: Login to Quay.io
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .action_templates/steps/set-run-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# see https://github.com/actions/runner/issues/432
- name: Restore last run status
id: last_run
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: last_run_status
key: ${{ github.run_id }}-${{ matrix.test-name }}-${{ matrix.distro }}
Expand Down
2 changes: 1 addition & 1 deletion .action_templates/steps/set-up-qemu.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
4 changes: 2 additions & 2 deletions .action_templates/steps/setup-and-install-python.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.10.4'
- name: Cache Dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ hashFiles('requirements.txt') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v3
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is being marked stale because it has been open for 60 days with no activity. Please comment if this issue is still affecting you. If there is no change, this issue will be closed in 30 days.'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code-health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
Mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Mypy linting
uses: jpetrucciani/mypy-check@179fdad632bf3ccf4cabb7ee4307ef25e51d2f96
Expand All @@ -30,4 +30,4 @@ jobs:
with:
go-version: stable
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v6
2 changes: 1 addition & 1 deletion .github/workflows/comment-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: startsWith(github.event.pull_request.title, 'Release MongoDB Kubernetes Operator')
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/e2e-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,31 @@ jobs:
steps:
# template: .action_templates/steps/checkout.yaml
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true
# template: .action_templates/steps/setup-and-install-python.yaml
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.10.4
- name: Cache Dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ hashFiles('requirements.txt') }}
- name: Install Python Dependencies
run: pip install -r requirements.txt
# template: .action_templates/steps/quay-login.yaml
- name: Login to Quay.io
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
# template: .action_templates/steps/set-up-qemu.yaml
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
# template: .action_templates/steps/build-and-push-development-images.yaml
- name: Build and Push Images
run: |
Expand All @@ -87,16 +87,16 @@ jobs:
steps:
# template: .action_templates/steps/checkout.yaml
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true
# template: .action_templates/steps/setup-and-install-python.yaml
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.10.4
- name: Cache Dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ hashFiles('requirements.txt') }}
Expand Down
115 changes: 0 additions & 115 deletions .github/workflows/e2e-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,6 @@ jobs:
if: contains(github.event.pull_request.labels.*.name, 'dependencies') || contains(github.event.pull_request.labels.*.name,
'safe-to-test')
steps:
# template: .action_templates/steps/cancel-previous.yaml
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc # 0.9.0
with:
access_token: ${{ github.token }}
# template: .action_templates/steps/checkout-fork.yaml
- name: Checkout Code
uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.sha}}
repository: ${{github.event.pull_request.head.repo.full_name}}
submodules: true
# template: .action_templates/steps/setup-and-install-python.yaml
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.10.4
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('requirements.txt') }}
- name: Install Python Dependencies
run: pip install -r requirements.txt
# template: .action_templates/steps/quay-login.yaml
- name: Login to Quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
# template: .action_templates/steps/set-up-qemu.yaml
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# template: .action_templates/steps/build-and-push-development-images.yaml
- name: Build and Push Images
run: |
Expand Down Expand Up @@ -152,89 +118,8 @@ jobs:
- test-name: replica_set_remove_user
distro: ubi
steps:
# template: .action_templates/steps/cancel-previous.yaml
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc # 0.9.0
with:
access_token: ${{ github.token }}
# template: .action_templates/steps/checkout-fork.yaml
- name: Checkout Code
uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.sha}}
repository: ${{github.event.pull_request.head.repo.full_name}}
submodules: true
# template: .action_templates/steps/set-run-status.yaml
- name: Set default run status
run: echo "::set-output name=last_run_status::pending" > last_run_status

# Tracking of the state of the previous test run is a workaround to the fact that it is not
# possible to re-run a single failed job, only re-running the entire workflow is currently possible.
# This workaround skips jobs if they have already passed.
# see https://github.com/actions/runner/issues/432
- name: Restore last run status
id: last_run
uses: actions/cache@v2
with:
path: last_run_status
key: ${{ github.run_id }}-${{ matrix.test-name }}-${{ matrix.distro }}

- name: Set last run status
id: last_run_status
run: cat last_run_status
# template: .action_templates/steps/setup-and-install-python.yaml
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.10.4
- name: Cache Dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ hashFiles('requirements.txt') }}
- name: Install Python Dependencies
run: pip install -r requirements.txt
# template: .action_templates/steps/setup-kind-cluster.yaml
- name: Setup Kind Cluster
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
chmod +x ./kind
./kind create cluster
if: steps.last_run_status.outputs.last_run_status != 'success'
- name: Create Directories
run: |
docker exec kind-control-plane mkdir -p /opt/data/mongo-data-0 /opt/data/mongo-data-1 /opt/data/mongo-data-2 /opt/data/mongo-logs-0 /opt/data/mongo-logs-1 /opt/data/mongo-logs-2

if: steps.last_run_status.outputs.last_run_status != 'success'
- name: Install CRD
run: kubectl apply -f config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml
if: steps.last_run_status.outputs.last_run_status != 'success'
# template: .action_templates/steps/run-test-matrix.yaml
- name: Run Test
id: e2e_test
if: steps.last_run_status.outputs.last_run_status != 'success'
run: |
cluster_wide=${{ matrix.cluster-wide }}
if [ -z "$cluster_wide" ]; then
cluster_wide="false"
fi
python3 ./scripts/dev/e2e.py --test ${{ matrix.test-name }} --tag ${{ github.run_id }} --config_file ./scripts/ci/config.json --distro ${{ matrix.distro }} --cluster-wide ${cluster_wide}
# template: .action_templates/steps/save-run-status.yaml
- name: Save run status
if: always()
run: echo "::set-output name=last_run_status::${{ steps.e2e_test.outcome }}"
> last_run_status
# template: .action_templates/steps/dump-and-upload-diagnostics.yaml
- name: Dump Diagnostics
id: dump_diagnostics
if: always() && steps.e2e_test.outcome == 'failure'
continue-on-error: true
run: scripts/ci/dump_diagnostics.sh default # default since kind is running in the default namespace

- name: Upload Diagnostics
if: always() && steps.dump_diagnostics.outcome == 'success'
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: ${{ matrix.test-name }}-${{ matrix.distro }}-diagnostics
path: ${{ github.workspace }}/diagnostics
Loading
Loading