From 4b5478646ff38c9d869c28b6ccf852ca3a68768d Mon Sep 17 00:00:00 2001 From: Daisie Huang Date: Tue, 1 Oct 2024 11:33:59 -0700 Subject: [PATCH] Update test.yml --- .github/workflows/test.yml | 52 +++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2feaec5..e1daf9b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,39 +1,39 @@ name: Github Actions Test on: [push] - jobs: build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.12"] + # Add in environment variables for the entire "build" job env: CANDIG_URL: "http://localhost" SERVICE_NAME: "federation" VAULT_URL: "http://localhost" CONFIG_DIR: "config" TRAVIS: true + strategy: + matrix: + python-version: ['3.12'] steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Build Docker image - run: docker image build --build-arg venv_python=${{ matrix.python-version }} --iidfile image.txt . - - name: Set up environment - run: | - docker run `sudo mkdir -p /run/secrets` - docker run `sudo touch /run/secrets/vault-approle-token` - docker run `sudo chmod 777 /run/secrets/vault-approle-token` - docker run `echo "test" > /run/secrets/vault-approle-token` - docker run `sudo mkdir -p /home/candig` - docker run `sudo touch /home/candig/roleid` - docker run `sudo chmod 777 /home/candig/roleid` - docker run `echo "test" > /home/candig/roleid` - docker run `pip install -r requirements.txt` - docker run `mkdir config` - - name: Test with pytest - run: docker run `pytest --cov=candig_federation tests/ -vv` + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: true + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install requirements + run: | + sudo mkdir -p /run/secrets + sudo touch /run/secrets/vault-approle-token + sudo chmod 777 /run/secrets/vault-approle-token + echo "test" > /run/secrets/vault-approle-token + sudo mkdir -p /home/candig + sudo touch /home/candig/roleid + sudo chmod 777 /home/candig/roleid + echo "test" > /home/candig/roleid + pip install -r requirements.txt + - name: Test with pytest + run: docker run `pytest --cov=candig_federation tests/ -vv`