Release #1
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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Release version (e.g., 1.2.3)' | |
| required: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Python lint deps | |
| run: pip install flake8==7.1.1 | |
| - name: Python lint | |
| run: flake8 src test | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install ESLint | |
| run: | | |
| npm init -y >/dev/null 2>&1 | |
| npm install eslint@9.0.0 >/dev/null 2>&1 | |
| - name: JavaScript lint | |
| run: npx eslint src test --ext .js | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Python unit tests | |
| run: | | |
| pip install pytest==8.3.3 >/dev/null 2>&1 | |
| PYTHONPATH=src python test/unit/slurmdb_validation.test.py | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Node unit tests | |
| run: node test/unit/calculator.test.js | |
| security-scan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install Bandit | |
| run: pip install bandit==1.8.0 | |
| - name: Run Bandit | |
| run: bandit -r src | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [lint, unit-tests, security-scan] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Build | |
| run: make build | |
| - name: Test | |
| run: make check || true | |
| - name: Create tag | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "github-actions@github.com" | |
| git tag v${{ github.event.inputs.version }} | |
| git push origin v${{ github.event.inputs.version }} | |
| - name: Package | |
| run: | | |
| make rpm | |
| make deb | |
| - name: Publish Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ github.event.inputs.version }} | |
| name: v${{ github.event.inputs.version }} | |
| files: | | |
| dist/**/* | |
| rpmbuild/RPMS/**/*.rpm | |
| slurmledger_*.deb | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |