Merge pull request #301 from AllenNeuralDynamics/fix_300_default_time… #80
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: Run integration tests | |
| on: | |
| push: | |
| branches: | |
| - dev | |
| jobs: | |
| integration_tests: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| AWS_METADATA_MAPPER_ROLE: ${{ secrets.AWS_METADATA_MAPPER_ROLE_PROD }} | |
| AWS_METADATA_MAPPER_BUCKET: ${{ vars.AWS_METADATA_MAPPER_BUCKET_PROD }} | |
| AWS_REGION: ${{ vars.AWS_REGION_PROD }} | |
| MOUNT_S3_URL: ${{ vars.MOUNT_S3_URL }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.10 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | |
| python -m pip install -e .[all] | |
| - name: Configure aws credentials | |
| uses: aws-actions/configure-aws-credentials@v2 | |
| with: | |
| role-to-assume: ${{ env.AWS_METADATA_MAPPER_ROLE }} | |
| role-session-name: github-integration-test-session | |
| aws-region: ${{ env.AWS_REGION }} | |
| - name: install mountpoint-s3 | |
| run: | | |
| wget $MOUNT_S3_URL | |
| sudo apt-get update | |
| sudo apt-get install ./mount-s3.deb | |
| - name: mount s3 bucket | |
| run: | | |
| mkdir bucket_mt | |
| mount-s3 $AWS_METADATA_MAPPER_BUCKET bucket_mt | |
| - name: run integration tests | |
| run: | | |
| python tests/integration/bergamo/session.py --input_source "bucket_mt/metadata-mapper-integration-testing/bergamo" IntegrationTestBergamo | |
| umount bucket_mt | |
| publish: | |
| needs: [integration_tests] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Compute new docker image tag | |
| run: | | |
| echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
| echo "branch=$(echo ${GITHUB_REF_NAME})" >> "$GITHUB_ENV" | |
| echo "docker_tag=$(echo ${GITHUB_REF_NAME})-$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Login to Github Packages | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build image and push to GitHub Container Registry | |
| uses: docker/build-push-action@v3 | |
| with: | |
| # relative path to the place where source code with Dockerfile is located | |
| context: . | |
| push: true | |
| tags: | | |
| ghcr.io/allenneuraldynamics/aind-metadata-mapper:${{ env.docker_tag }} | |
| ghcr.io/allenneuraldynamics/aind-metadata-mapper:dev |