Makes the AWS client stack optional #81
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| MIX_ENV: test | |
| jobs: | |
| compile: | |
| name: Compile | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: "1.18" | |
| otp-version: "27" | |
| - name: Cache deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: deps | |
| key: deps-${{ runner.os }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: deps-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile | |
| run: mix compile --warnings-as-errors | |
| quality: | |
| name: Quality (Elixir ${{ matrix.elixir }} / OTP ${{ matrix.otp }}) | |
| needs: compile | |
| runs-on: ubuntu-latest | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| KMS_KEY_ARN: ${{ secrets.KMS_KEY_ARN }} | |
| AWS_REGION: us-east-1 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Oldest supported | |
| - elixir: "1.16" | |
| otp: "26" | |
| # Middle ground | |
| - elixir: "1.17" | |
| otp: "26" | |
| # Latest (with coverage upload) | |
| - elixir: "1.18" | |
| otp: "27" | |
| coverage: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ matrix.elixir }} | |
| otp-version: ${{ matrix.otp }} | |
| - name: Cache deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: deps | |
| key: deps-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| deps-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}- | |
| deps-${{ runner.os }}- | |
| - name: Cache _build | |
| uses: actions/cache@v4 | |
| with: | |
| path: _build | |
| key: build-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| build-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}- | |
| - name: Cache PLT | |
| uses: actions/cache@v4 | |
| with: | |
| path: priv/plts | |
| key: plt-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles('**/mix.lock') }} | |
| restore-keys: | | |
| plt-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}- | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Cache test vectors | |
| uses: actions/cache@v4 | |
| with: | |
| path: test/fixtures/test_vectors | |
| key: test-vectors-${{ hashFiles('.github/workflows/ci.yml') }} | |
| restore-keys: test-vectors- | |
| - name: Setup test vectors | |
| run: | | |
| if [ ! -d "test/fixtures/test_vectors/.git" ]; then | |
| git clone --depth 1 https://github.com/awslabs/aws-encryption-sdk-test-vectors.git \ | |
| test/fixtures/test_vectors | |
| cd test/fixtures/test_vectors/vectors/awses-decrypt | |
| unzip -q python-2.3.0.zip | |
| fi | |
| - name: Run quality checks | |
| run: mix quality | |
| - name: Generate coverage report | |
| if: matrix.coverage | |
| run: mix coveralls.json | |
| - name: Upload coverage to Codecov | |
| if: matrix.coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: cover/excoveralls.json | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| no-aws-deps: | |
| name: Raw keyrings without AWS deps | |
| runs-on: ubuntu-latest | |
| env: | |
| # Drops the optional ex_aws/ex_aws_kms/hackney/sweet_xml stack from | |
| # deps entirely, proving the raw-keyring path stands alone. See | |
| # aws_kms_deps/0 in mix.exs. | |
| NO_AWS_DEPS: "1" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: "1.18" | |
| otp-version: "27" | |
| - name: Install dependencies | |
| run: mix deps.get | |
| - name: Compile without AWS deps | |
| run: mix compile --warnings-as-errors | |
| - name: Cache test vectors | |
| uses: actions/cache@v4 | |
| with: | |
| path: test/fixtures/test_vectors | |
| key: test-vectors-${{ hashFiles('.github/workflows/ci.yml') }} | |
| restore-keys: test-vectors- | |
| - name: Setup test vectors | |
| run: | | |
| if [ ! -d "test/fixtures/test_vectors/.git" ]; then | |
| git clone --depth 1 https://github.com/awslabs/aws-encryption-sdk-test-vectors.git \ | |
| test/fixtures/test_vectors | |
| cd test/fixtures/test_vectors/vectors/awses-decrypt | |
| unzip -q python-2.3.0.zip | |
| fi | |
| - name: Run tests without AWS deps | |
| run: mix test |