change #2
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-matrix | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| branches: | |
| - master | |
| jobs: | |
| generate-dbip: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Checkout dbip file from generated-source branch | |
| run: | | |
| git checkout generated-source -- ip_country/src/dbip_country.rs | |
| build: | |
| needs: generate-dbip | |
| if: github.event.pull_request.draft == false | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| target: | |
| - { name: linux, os: ubuntu-22.04 } | |
| - { name: macos, os: macos-13 } | |
| - { name: windows, os: windows-2022 } | |
| name: Build node on ${{ matrix.target.os }} | |
| runs-on: ${{ matrix.target.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Print source branch name | |
| run: | | |
| echo "Source branch: ${{ github.head_ref }}" | |
| shell: bash | |
| - name: Stable with rustfmt and clippy | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: 1.63.0 | |
| components: rustfmt, clippy | |
| override: true | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/cache/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Download dbip file | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: dbip_country | |
| - name: Move and overwrite dbip file | |
| shell: bash | |
| run: cp -f dbip_country.rs ip_country/src/dbip_country.rs || exit 1 | |
| - name: Show dbip file | |
| run: cat ip_country/src/dbip_country.rs | |
| - name: Build ${{ matrix.target.os }} | |
| run: | | |
| ./ci/all.sh | |
| ./ci/multinode_integration_test.sh | |
| ./ci/collect_results.sh | |
| shell: bash | |
| - name: Publish ${{ matrix.target.os }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Node-${{ matrix.target.name }} | |
| path: results | |
| - name: diagnostics | |
| if: failure() | |
| run: | | |
| echo "final disc diagnostics ------>" | |
| df -h /Users/runner/work/Node/Node/node/target/release | |
| deploy_to_s3: | |
| needs: build | |
| if: success() && (startsWith(github.head_ref, 'GH') || startsWith(github.head_ref, 'v')) | |
| strategy: | |
| matrix: | |
| os: [linux, macos, windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 1 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Display structure of downloaded files | |
| run: ls -R | |
| - name: Check artifacts exist | |
| run: | | |
| if [ ! -d "Node-${{ matrix.os }}/generated/bin/" ]; then | |
| echo "Error: Build artifacts not found" | |
| exit 1 | |
| fi | |
| - name: Configure AWS Credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-west-2 | |
| - if: startsWith(github.head_ref, 'GH') | |
| name: Versioned S3 Sync | |
| run: | | |
| aws s3 sync "Node-${{ matrix.os }}/generated/bin/" "s3://${{ secrets.AWS_S3_BUCKET }}/Node/${{ github.head_ref }}/Node-${{ matrix.os }}" \ | |
| --delete \ | |
| --no-progress \ | |
| --acl private | |
| - if: startsWith(github.head_ref, 'v') | |
| name: Latest S3 Sync | |
| run: | | |
| aws s3 sync "Node-${{ matrix.os }}/generated/bin/" "s3://${{ secrets.AWS_S3_BUCKET }}/Node/latest/Node-${{ matrix.os }}" \ | |
| --delete \ | |
| --no-progress \ | |
| --acl private | |
| - name: Invalidate Binaries CloudFront | |
| uses: chetan/[email protected] | |
| env: | |
| DISTRIBUTION: ${{ secrets.DISTRIBUTION }} | |
| PATHS: "/Node*" | |
| AWS_REGION: "us-west-2" | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |