CI/CD実装 #22
Workflow file for this run
This file contains 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/cd | |
on: | |
pull_request: | |
branches: | |
- "main" | |
types: ["opened", "synchronize"] | |
permissions: | |
id-token: write | |
contents: read | |
pull-requests: read | |
env: | |
SERVICE: ${{ secrets.SERVICE }} | |
ENV: test | |
jobs: | |
test-prep: | |
runs-on: ubuntu-22.04 | |
steps: | |
# - name: Confirm minimum permissions | |
# uses: GitHubSecurityLab/actions-permissions/monitor@v1 | |
# with: | |
# config: ${{ vars.PERMISSIONS_CONFIG }} | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Setup job | |
uses: ./.github/actions/setup | |
with: | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.SERVICE_ACCOUNT }} | |
- name: Apply tier1 | |
run: | | |
TF_VAR_service=$SERVICE \ | |
TF_VAR_env=$ENV \ | |
./terraform/environments/test/tier1/apply.sh | |
test: | |
needs: test-prep | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
shard: [s1 s2] | |
steps: | |
# - name: Confirm minimum permissions | |
# uses: GitHubSecurityLab/actions-permissions/monitor@v1 | |
# with: | |
# config: ${{ vars.PERMISSIONS_CONFIG }} | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Setup job | |
uses: ./.github/actions/setup | |
with: | |
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.SERVICE_ACCOUNT }} | |
- name: Run tests | |
run: | | |
echo "shard: ${{ matrix.shard }}" | |
cat ./.github/test_matrix.yaml | jq .${{ matrix.shard }} | |
# build: | |
# needs: test | |
# runs-on: ubuntu-22.04 | |
# env: | |
# SERVICE: ${{ secrets.SERVICE }} | |
# ENV: test | |
# steps: | |
# - name: Checkout project | |
# uses: actions/checkout@v4 | |
# - name: Setup job | |
# uses: ./.github/actions/setup | |
# with: | |
# workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | |
# service_account: ${{ secrets.SERVICE_ACCOUNT }} |