chore(deps): update toshimaru/auto-author-assign action to v3.1.0 (#195) #224
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - 'feature/**' | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| name: ${{ matrix.name }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Test, Arch amd64 | |
| arch: amd64 | |
| os: ubuntu-latest | |
| container: '' | |
| - name: Test, Arch arm64 | |
| arch: arm64 | |
| os: ubuntu-24.04-arm | |
| container: '' | |
| # The custom runner job validates the containerised CI environment | |
| # that consumer projects run the seeding in. Linting and coverage | |
| # run only in this job because the ci-runner image bundles shfmt | |
| # and kcov. | |
| - name: Test, Arch amd64, custom runner | |
| arch: amd64 | |
| os: ubuntu-latest | |
| # https://hub.docker.com/r/drevops/ci-runner | |
| container: drevops/ci-runner:26.6.0@sha256:190027056cac7b7ce28c29a1e5494779ebadc4ee8e95d468b75bc56e7be5aabd | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.container }} | |
| steps: | |
| - name: Configure Git safe directory | |
| run: git config --global --add safe.directory "${GITHUB_WORKSPACE}" | |
| - name: Check out the repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - name: Lint shell scripts | |
| if: matrix.container != '' | |
| run: | | |
| shfmt -i 2 -ci -s -d seed.sh tests/bats/*.bash tests/bats/*.bats | |
| shellcheck seed.sh tests/bats/*.bash tests/bats/*.bats | |
| continue-on-error: ${{ vars.CI_LINT_IGNORE_FAILURE == '1' }} | |
| - name: Install goss | |
| run: | | |
| GOSS_VERSION=v0.4.9 | |
| mkdir -p "${HOME}/bin" | |
| curl -fsSL "https://github.com/goss-org/goss/releases/download/${GOSS_VERSION}/goss-linux-${{ matrix.arch }}" -o "${HOME}/bin/goss" | |
| curl -fsSL "https://github.com/goss-org/goss/releases/download/${GOSS_VERSION}/dgoss" -o "${HOME}/bin/dgoss" | |
| chmod +rx "${HOME}/bin/goss" "${HOME}/bin/dgoss" | |
| "${HOME}/bin/goss" --version | |
| - name: Build Docker image | |
| run: docker build -t gosstestorg/gosstestimage:goss-test-tag . | |
| - name: Run Goss tests | |
| run: | | |
| export GOSS_FILES_STRATEGY=cp | |
| export GOSS_PATH="${HOME}/bin/goss" | |
| GOSS_FILES_PATH=tests/dgoss "${HOME}/bin/dgoss" run -i gosstestorg/gosstestimage:goss-test-tag | |
| continue-on-error: ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }} | |
| - name: Install BATS dependencies | |
| run: npm --prefix tests/bats ci | |
| - name: Run BATS tests with code coverage | |
| if: matrix.container != '' | |
| run: | | |
| echo "${DOCKER_PASS}" | docker login --username "${DOCKER_USER}" --password-stdin | |
| kcov --include-pattern=.sh,.bash --bash-parse-files-in-dir=. --exclude-pattern=vendor,node_modules,coverage $(pwd)/coverage tests/bats/node_modules/.bin/bats tests/bats | |
| shell: bash | |
| continue-on-error: ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }} | |
| env: | |
| DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
| DOCKER_PASS: ${{ secrets.DOCKER_PASS }} | |
| - name: Run BATS tests | |
| if: matrix.container == '' | |
| run: | | |
| echo "${DOCKER_PASS}" | docker login --username "${DOCKER_USER}" --password-stdin | |
| tests/bats/node_modules/.bin/bats tests/bats | |
| shell: bash | |
| continue-on-error: ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }} | |
| env: | |
| DOCKER_USER: ${{ secrets.DOCKER_USER }} | |
| DOCKER_PASS: ${{ secrets.DOCKER_PASS }} | |
| - name: Upload coverage report as an artifact | |
| if: matrix.container != '' | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 | |
| with: | |
| name: ${{github.job}}-code-coverage-report | |
| include-hidden-files: true | |
| path: coverage | |
| if-no-files-found: error | |
| - name: Upload coverage report to Codecov | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 | |
| if: ${{ matrix.container != '' && env.CODECOV_TOKEN != '' }} | |
| with: | |
| directory: coverage | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| push-canary-to-registry: | |
| if: github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4 | |
| with: | |
| username: ${{ secrets.DOCKER_USER }} | |
| password: ${{ secrets.DOCKER_PASS }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6 | |
| with: | |
| images: drevops/mariadb-drupal-data | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7 | |
| with: | |
| context: . | |
| push: true | |
| tags: drevops/mariadb-drupal-data:canary | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/amd64,linux/arm64 |